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

Remove use of http_uri:encode #6

Merged
merged 1 commit into from
Jan 3, 2023
Merged

Conversation

jamesvl
Copy link

@jamesvl jamesvl commented Oct 11, 2022

Overview

This removes the use of the deprecated http_uri module and replaces it with the recommend uri_string module.

uri_string has been recommended since OTP 21, and http_uri will be removed completely in OTP 26.

Changes

This uses uri_string:compose_query/1 to build up the query parameters (instead of manually concatenating a binary). It relies on the the function's behavior that will put keys and values through uri_string:quote() (so we must be sure we don't double-encode).

In testing several XML payloads run through base64:encode_to_string(zlib:zip(Req)) and then comparing the results of both http_uri:encode() vs. uri_string:quote(), my results consistently matched. If there is a known difference between the output of the two functions?

Unknowns

  • is uri_string:normalize() on the RelayState also doing percent encoding?
  • is there a cleaner way to maybe add the "username" parameter to the QueryList?

@CLAassistant
Copy link

CLAassistant commented Oct 11, 2022

CLA assistant check
All committers have signed the CLA.

@k-cross
Copy link

k-cross commented Nov 16, 2022

Oh cool thank you for looking into this! I remember trying something a while back and it did not encode correctly which is why I left it. Things may be different now, that was a few years ago. I'll verify it works sometime soon. Thanks again!

@k-cross k-cross merged commit c60f5e3 into dropbox:main Jan 3, 2023
@k-cross
Copy link

k-cross commented Jan 3, 2023

Sorry it wasn't quicker, I just got around to verifying

@martosaur
Copy link

martosaur commented Jun 21, 2023

For anyone stumbling upon this PR: uri_string:quote was introduced in OTP 25, which makes esaml incompatible with previous versions starting with 4.5.0 release

ns-codereview pushed a commit to couchbase/ns_server that referenced this pull request Feb 14, 2024
This copies dropbox/esaml#6 to remove the use
of the deprecated http_uri module and replace it with the recommended
uri_string module.

Also copies dropbox/esaml#7 to get rid of extra
uri encoding.

Change-Id: I57f978321ba04556e9047838725a6fd1de0b0c1c
Reviewed-on: https://review.couchbase.org/c/ns_server/+/204526
Tested-by: Build Bot <build@couchbase.com>
Well-Formed: Build Bot <build@couchbase.com>
Tested-by: Steve Watanabe <steve.watanabe@couchbase.com>
Reviewed-by: Ben Huddleston <ben.huddleston@couchbase.com>
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.

4 participants