1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-17 23:17:38 +00:00

Fix double URL decode

Closes #613
This commit is contained in:
Jonathan Coates
2020-12-20 19:57:31 +00:00
committed by Jummit
parent 58cd5e3df7
commit 20a9ff7a3f

View File

@@ -9,10 +9,8 @@ package dan200.computercraft.core.apis.http.request;
import static dan200.computercraft.core.apis.http.request.HttpRequest.getHeaderSize;
import java.io.Closeable;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
@@ -228,8 +226,8 @@ public final class HttpRequestHandler extends SimpleChannelInboundHandler<HttpOb
}
try {
return this.uri.resolve(new URI(URLDecoder.decode(location, "UTF-8")));
} catch (UnsupportedEncodingException | IllegalArgumentException | URISyntaxException e) {
return this.uri.resolve(new URI( location ));
} catch( IllegalArgumentException | URISyntaxException e ) {
return null;
}
}