-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property values are not URL quoted for matrix parameters #408
Comments
It'd be great!
I'm not sure how to detect this state... If we quote properties - it may broke the current usage. Is there a way to detect that properties have been quoted already? What do you think about adding a parameter |
While we could guess, as humans, it ends up being impossible to determine this without knowing intent, because we don't know if the caller intended to literally store an encoded value like
I was also going to suggest that approach! It's something I often use in other projects to make breaking changes over time:
Sometimes supplement 2) with a default value of
This ensures people who don't chose a value will be notified, and removes the warning for anyone who makes an explicit choice (in either direction). I took a look at the release cycle and it seems like there's releases basically only when necessary (not a defined/periodic release), so I don't think we'd have to worry too much about skipping versions for the breaking change. In that case I will start a PR for the above and put out a warning that the default will change in |
It sounds amazing! 🚀 |
This only affects matrix parameters as far as I can tell; we should not quote parameters that are set after the fact because those go through a POST.
Because property values aren't encoded/quoted, it can cause undesirable characters to make it into properties, or cause the properties to be truncated. For example if your value contains a question mark
?
, it seems to get stripped somewhere; this character plus any characters after it do not end up in the property value.If your value contains
%
followed by any hex value, the resulting character with that code will be inserted into the property value instead of the literal, for example if your value contains%0
you'll end up with a null character in the value.Example repros (can be done with the stock Artifactory OSS container):
I believe this should be fixable with
urllib3.quote
being applied to each version.If this is an acceptable fix, I might be able to put up a PR for it.
If the position of the library is that callers are responsible for encoding their property values, then we must also make that explicit (because if callers quote their values now, and later the library adds quoting, it will double encode and ruin the values).
For the same reason, if we do opt to do quoting in the library, we should call it out as a breaking change.
The text was updated successfully, but these errors were encountered: