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

[COOK-3857] do not unescape the java windows url before parsing it #90

Merged
merged 1 commit into from
Dec 12, 2013

Conversation

b-dean
Copy link
Contributor

@b-dean b-dean commented Oct 21, 2013

@carmstrong
Copy link
Contributor

Is this still necessary after merging #100 ?

@b-dean
Copy link
Contributor Author

b-dean commented Dec 12, 2013

Absolutely. Here's an example. Let's say that node['java']['windows']['url'] had a value of http://localhost:8080/Oracle%20Java/1.6.0_45/jdk-6u45-windows-x64.exe If you unescape that, then try to parse it, it will fail to parse. URI.parse cannot parse URIs that have unescaped characters. You can see that even in irb:

1.9.3p484 :001 > require 'uri'
 => true 
1.9.3p484 :002 > java_uri = 'http://localhost:8080/Oracle%20Java/1.6.0_45/jdk-6u45-windows-x64.exe'
 => "http://localhost:8080/Oracle%20Java/1.6.0_45/jdk-6u45-windows-x64.exe" 
1.9.3p484 :003 > URI.parse(java_uri)
 => #<URI::HTTP:0x00000000f343c8 URL:http://localhost:8080/Oracle%20Java/1.6.0_45/jdk-6u45-windows-x64.exe> 
1.9.3p484 :004 > URI.parse(URI.unescape(java_uri))
URI::InvalidURIError: bad URI(is not URI?): http://localhost:8080/Oracle Java/1.6.0_45/jdk-6u45-windows-x64.exe
    from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/uri/common.rb:176:in `split'
    from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/uri/common.rb:211:in `parse'
    from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/uri/common.rb:747:in `parse'
    from (irb):4
    from /usr/local/rvm/rubies/ruby-1.9.3-p484/bin/irb:12:in `<main>'

carmstrong added a commit that referenced this pull request Dec 12, 2013
[COOK-3857] do not unescape the java windows url before parsing it
@carmstrong carmstrong merged commit ac899af into sous-chefs:master Dec 12, 2013
@carmstrong
Copy link
Contributor

Cool, thanks for confirming. Trying to clean up these old PRs.

@b-dean b-dean deleted the COOK-3857 branch February 25, 2014 21:37
@lock
Copy link

lock bot commented May 3, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants