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) #521 trim leading and trailing empty values in parse_qs #523

Merged
merged 3 commits into from Sep 10, 2018
Merged

(fix) #521 trim leading and trailing empty values in parse_qs #523

merged 3 commits into from Sep 10, 2018

Conversation

leonardb
Copy link
Contributor

Fixes crash in parse_qs when qs contains extra ampersands

@benoitc
Copy link
Owner

benoitc commented Aug 30, 2018

when trim_all has been added to OTP? Was it always there?

@leonardb
Copy link
Contributor Author

Looks like it was added in 18. If this still needs to be compatible with < 18 we can change

@benoitc
Copy link
Owner

benoitc commented Aug 30, 2018 via email

@edgurgel
Copy link
Collaborator

edgurgel commented Sep 4, 2018

Do we really support < 18? c29aec2#diff-354f30a63fb0907d4ad57269548329e3

@leonardb
Copy link
Contributor Author

leonardb commented Sep 6, 2018

I'm not sure if we can achieve this reliably and safely using a regex. If we want to do this safely I could always extract the binary:split/3 logic/code from 18 into a local function as a stop-gap until you decide to formally drop support for < 18

@benoitc
Copy link
Owner

benoitc commented Sep 10, 2018

If we want to do this safely I could always extract the binary:split/3 logic/code from 18 into a local function as a stop-gap until you decide to formally drop support for < 18

Indeed. Doing it would allows us to include the change in 1.x directly, with a proper note to remove that hack in coming 2.x release.

@edgurgel hackney is still supposed to work on 17.x and sup. even if not advised. That support will be officially removed in 2.x .

@leonardb
Copy link
Contributor Author

@benoitc Which module would you prefer this to be in?

  1. hackney_bstr.erl
  2. hackney_util.erl
  3. hackney_url.erl

@benoitc
Copy link
Owner

benoitc commented Sep 10, 2018

Right :) I think hackney_bstr is the right place for it.

@leonardb
Copy link
Contributor Author

@benoitc Ready for review

@benoitc benoitc merged commit b98f89d into benoitc:master Sep 10, 2018
@benoitc
Copy link
Owner

benoitc commented Sep 10, 2018

@leonardb thanks!, changes looked good, merged it :) release will happen later today

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.

None yet

3 participants