docusign-esign-ruby-client icon indicating copy to clipboard operation
docusign-esign-ruby-client copied to clipboard

Fix obsolete uri escape warning

Open emilford opened this issue 4 years ago • 9 comments

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

emilford avatar Jul 30 '20 21:07 emilford

The existing tests also fail on master: https://travis-ci.org/github/docusign/docusign-ruby-client/branches.

emilford avatar Jul 30 '20 22:07 emilford

:wave: @LarryKlugerDS, any thoughts on this PR? Thanks!

emilford avatar Aug 05 '20 15:08 emilford

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 Screen Shot 2020-09-02 at 10 35 22

nicolasrouanne avatar Sep 02 '20 08:09 nicolasrouanne

I'm sorry for the slow response. I have opened DCM-4886 for engineering to review the PR

LarryKlugerDS avatar Nov 01 '20 12:11 LarryKlugerDS

Any updates on this?

matheusbsilva avatar Dec 23 '20 14:12 matheusbsilva

Instead of adding another gem, is it possible just to change the call to URI.encode_www_form_component?

MatheusRich avatar Dec 29 '20 20:12 MatheusRich

@LarryKlugerDS Any updates on this?

sposin avatar Feb 08 '21 18:02 sposin

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 avatar Apr 06 '21 22:04 joshkinabrew

@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.

barash-asenov avatar Jun 02 '21 14:06 barash-asenov