docusign-esign-ruby-client
docusign-esign-ruby-client copied to clipboard
Fix obsolete uri escape warning
Prior to these changes, URI.escape
would trigger a warning. Instead, this uses Addressable::URI.escape
to maintain similar behavior, but without the warning. One difference between the two being how the #
sign is handled. URI.escape
escapes this character. Addressable::URI.escape
does not.
See this link for more information:
https://stackoverflow.com/a/13059657
Resolves: #45
The existing tests also fail on master
: https://travis-ci.org/github/docusign/docusign-ruby-client/branches.
:wave: @LarryKlugerDS, any thoughts on this PR? Thanks!
Could we have this merged please? 🙏 Docusign is the only gem in my projects raising warnings in ruby 2.7, it's really annoying 😢
This is what my tests look like now
I'm sorry for the slow response. I have opened DCM-4886 for engineering to review the PR
Any updates on this?
Instead of adding another gem, is it possible just to change the call to URI.encode_www_form_component
?
@LarryKlugerDS Any updates on this?
URI.escape
is completely removed in Ruby 3. This needs to be merged before full Ruby 3 support.
I don't think this is the correct way of fixing it (adding another gem) - I agree with @MatheusRich 's solution of just using URI.encode_www_form_component
as it seems like the logical replacement.
I would love to get this fix out ASAP @LarryKlugerDS so I don't have to run on a fork.
@joshkinabrew This is what happens when you use URI.encode_www_form_component on a full URL
URI.encode_www_form_component('https://www.google.com')
will yield the result of
https%3A%2F%2Fwww.google.com
Addressable::URI.encode('https://www.google.com')
will yield
https://www.google.com
URI.encode_www_form_componenet
is quite similar to CGI escape and I think meant to be used on only query params rather than the full URL
https://stackoverflow.com/questions/2824126/whats-the-difference-between-uri-escape-and-cgi-escape
Also the encoding style is different
URI.encode_www_form_component('space space')
yields
space+space
and
Addressable::URI.encode('space space')
yields
space%20space
as it was with URI.encode as I remember.
I agree that it is quite bad to bring extra dependency but I also think this is the fastest fix. Otherwise, it will be quite a big work.