Skip to content
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

Fix: URL Encode keys and values in URL encoded form data #698

Merged

Conversation

jamietanna
Copy link
Contributor

As noted in #687, the existing implementation of our querystring
construction was not valid according to the HTTP/1.1 specification,
which was noticed with an integration issue with Apache Tomcat.

This affects both the generation of Query Strings, and URL encoded form
parameters.

The solution is to ensure that we always URL-encode the keys, as well as
the values.

It appears that the existing test we had for this, "returns a Rails
style query string", was not actually quite testing what we thought it
was, as we had not tested the rendering of the raw values, only the URL
decoded ones.

Closes #697.

As noted in jnunemaker#687, the existing implementation of our querystring
construction was not valid according to the HTTP/1.1 specification,
which was noticed with an integration issue with Apache Tomcat.

This affects both the generation of Query Strings, and URL encoded form
parameters.

The solution is to ensure that we always URL-encode the keys, as well as
the values.

It appears that the existing test we had for this, "returns a Rails
style query string", was not actually quite testing what we thought it
was, as we had not tested the rendering of the raw values, only the URL
decoded ones.

Closes jnunemaker#697.
Copy link
Collaborator

@TheSmartnik TheSmartnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate your work, thank you!

@TheSmartnik TheSmartnik merged commit d9c4f3a into jnunemaker:master Apr 17, 2020
@jamietanna jamietanna deleted the defect/uri-encode-querystring-params branch April 19, 2020 20:45
alan-gds added a commit to GovWifi/govwifi-admin that referenced this pull request Dec 2, 2020
This required changing some test expectations, because httparty now encodes keys in query parameters.  jnunemaker/httparty#698
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Querystring parameters do not seem to be URL-encoded correctly
2 participants