Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
"=" in query parameter values #1120
When a query parameter value contains a "=", akka-http throws the following exception:
It doesn't matter whether you're in strict or relaxed mode, the equals sign is not allowed.
When looking at RFC3986 page 23 however, query is defined as:
And its types as:
According to this definition the equals sign should be allowed. Am I missing something, or is this a bug in akka-http?
True, I wouldn't use "=" in values myself, but Angular2 for example doesn't escape it as well, hence requiring custom work otherwise.
Thanks, @jacktol. I think this has been discussed a few times but cannot find a good reference right now.
You are right that according to RFC 3986, '=' would be valid everywhere. However, RFC 3986 does not define the semantics of the query string so other specs (like W3C Html specs) could still be stricter than what RFC 3986 allows.
The basic question is how to tell apart if the second '=' should be part of the name or of the value of the parameter. If there's no unambiguous spec we usually punt and take the stricter approach.
The best document that would give an unambiguous meaning of multiple '=' in a parameter is the one at https://url.spec.whatwg.org/#urlencoded-parsing:
So, I guess at least in relaxed mode we could go with that definition.
referenced this issue
Jun 9, 2017
The other problem here is error handling.
@jrudolph I agree with your proposal to use the whatwg standard for