Issue #1568 handle query strings with encoded characters
This commit is contained in:
parent
78280d0595
commit
50500ac99d
|
@ -45,7 +45,7 @@ public final class WSURI
|
|||
if ("http".equalsIgnoreCase(wsScheme) || "https".equalsIgnoreCase(wsScheme))
|
||||
{
|
||||
// leave alone
|
||||
return inputUri; // TODO should this be cloned?
|
||||
return new URI(inputUri.toString());
|
||||
}
|
||||
|
||||
if ("ws".equalsIgnoreCase(wsScheme))
|
||||
|
@ -117,26 +117,24 @@ public final class WSURI
|
|||
{
|
||||
Objects.requireNonNull(inputUri,"Input URI must not be null");
|
||||
String httpScheme = inputUri.getScheme();
|
||||
String wsScheme = null;
|
||||
if ("ws".equalsIgnoreCase(httpScheme) || "wss".equalsIgnoreCase(httpScheme))
|
||||
{
|
||||
// keep as-is
|
||||
wsScheme = httpScheme;
|
||||
return new URI(inputUri.toString());
|
||||
}
|
||||
else if ("http".equalsIgnoreCase(httpScheme))
|
||||
|
||||
if ("http".equalsIgnoreCase(httpScheme))
|
||||
{
|
||||
// convert to ws
|
||||
wsScheme = "ws";
|
||||
return new URI("ws"+inputUri.toString().substring(4));
|
||||
}
|
||||
else if ("https".equalsIgnoreCase(httpScheme))
|
||||
|
||||
if ("https".equalsIgnoreCase(httpScheme))
|
||||
{
|
||||
// convert to wss
|
||||
wsScheme = "wss";
|
||||
return new URI("wss"+inputUri.toString().substring(5));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new URISyntaxException(inputUri.toString(),"Unrecognized HTTP scheme");
|
||||
}
|
||||
return new URI(wsScheme,inputUri.getUserInfo(),inputUri.getHost(),inputUri.getPort(),inputUri.getPath(),inputUri.getQuery(),inputUri.getFragment());
|
||||
|
||||
throw new URISyntaxException(inputUri.toString(),"Unrecognized HTTP scheme");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue