add javadoc and null check for HttpScheme

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2021-06-16 00:40:35 +10:00
parent 148cf38c5d
commit 10ed23f22d
2 changed files with 7 additions and 0 deletions

View File

@ -103,6 +103,9 @@ public final class WSURI
{
Objects.requireNonNull(inputUri, "Input URI must not be null");
String httpScheme = inputUri.getScheme();
if (httpScheme == null)
throw new URISyntaxException(inputUri.toString(), "Undefined HTTP scheme");
if ("ws".equalsIgnoreCase(httpScheme) || "wss".equalsIgnoreCase(httpScheme))
return inputUri;

View File

@ -50,6 +50,10 @@ public final class ClientUpgradeRequest implements UpgradeRequest
this.host = null;
}
/**
* @deprecated use the no-args constructor instead.
* @see ClientUpgradeRequest#ClientUpgradeRequest()
*/
@Deprecated
public ClientUpgradeRequest(URI uri)
{