You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JVMCBC-1588 Fix parsing connection string where parameter value is URI
Motivation
----------
With the upcoming application telemetry feature,
we can expect users to specify the telemetry endpoint
with a connection string like this (note absent scheme):
127.0.0.1?app_telemetry_endpoint=ws://example.com
When the scheme is omitted as in this example,
and there's a parameter value that contains a URI,
the connection string parser erroneously treats
everything before "://" as the connection string scheme.
This fails.
Modifications
-------------
Adjust the connection string scheme regex to disallow
question marks.
Rejected Alternatives
---------------------
RFC 2396 defines URI scheme as:
scheme = alpha *( alpha | digit | "+" | "-" | "." )
where alpha is [a-zA-Z] and digit is [0-9].
By that definition, a strict Java regex for our scheme
would be:
"((?<scheme>\\p{Alpha}[\\p{Alnum}+.-]*?)://)?"
but that seemed needlessly pedantic for our purposes.
Change-Id: Iafed4cec5cde5ba00ea607b844b3c941b49748cd
Reviewed-on: https://review.couchbase.org/c/couchbase-jvm-clients/+/221172
Tested-by: Build Bot <[email protected]>
Reviewed-by: Michael Reiche <[email protected]>
0 commit comments