mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-23 00:24:11 -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.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URL;
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
public class URLDebugInformationProvider implements DebugInformationProvider {
|
public class URLDebugInformationProvider implements DebugInformationProvider {
|
||||||
private String baseURL;
|
private String baseURL;
|
||||||
|
@ -29,11 +30,13 @@ public class URLDebugInformationProvider implements DebugInformationProvider {
|
||||||
@Override
|
@Override
|
||||||
public DebugInformation getDebugInformation(String script) {
|
public DebugInformation getDebugInformation(String script) {
|
||||||
try {
|
try {
|
||||||
URL url = new URL(baseURL + script + ".teavmdbg");
|
URI uri = new URI(baseURL + script);
|
||||||
try (InputStream input = url.openStream()) {
|
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);
|
return DebugInformation.read(input);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException | URISyntaxException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user