mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix debugging when script is included with additional query string
This commit is contained in:
parent
e147a998e5
commit
a7df41d41d
|
@ -17,7 +17,8 @@ package org.teavm.debugging.information;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
public class URLDebugInformationProvider implements DebugInformationProvider {
|
||||
private String baseURL;
|
||||
|
@ -29,11 +30,13 @@ public class URLDebugInformationProvider implements DebugInformationProvider {
|
|||
@Override
|
||||
public DebugInformation getDebugInformation(String script) {
|
||||
try {
|
||||
URL url = new URL(baseURL + script + ".teavmdbg");
|
||||
try (InputStream input = url.openStream()) {
|
||||
URI uri = new URI(baseURL + script);
|
||||
uri = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(),
|
||||
uri.getPath() + ".teavmdbg", uri.getQuery(), uri.getFragment());
|
||||
try (InputStream input = uri.toURL().openStream()) {
|
||||
return DebugInformation.read(input);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} catch (IOException | URISyntaxException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user