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

padrino parses path components incorrectly #1391

Closed
ghost opened this Issue Sep 2, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@ghost

ghost commented Sep 2, 2013

I seem to get incorrect results when encoding a slash part of the url path:

example controller:

DemoProject::App.controllers :resources, :use_format => false do
  get :index, :with => [:drive_alias, :path], :path => /.*/ do
    params.inspect
  end  
end

When I request /resources/drive/some/path behaviour is correct.
When I want to name my drive "drive/foo" and encode it in the URL, as /resources/drive%2Ffoo/some/path I get unexpected results:

{:drive_alias=>"drive", :path=>"foo/some/path"}

Note how the encoded path component got decoded prematurely causing the "foo" to be stripped from the drive alias into moved into the path section.

Cheers
Slawo

@namusyaka

This comment has been minimized.

Show comment
Hide comment
Member

namusyaka commented Sep 11, 2013

@namusyaka

This comment has been minimized.

Show comment
Hide comment
@namusyaka

namusyaka Sep 11, 2013

Member

According to this, seems to should not decode the encoded slash.
I'll send a patch about this.

Member

namusyaka commented Sep 11, 2013

According to this, seems to should not decode the encoded slash.
I'll send a patch about this.

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Oct 23, 2013

Member

Broken after rack-protection >= 1.5.1

Member

ujifgc commented Oct 23, 2013

Broken after rack-protection >= 1.5.1

@ujifgc ujifgc reopened this Oct 23, 2013

@namusyaka namusyaka closed this in 2aa22ea Oct 23, 2013

ujifgc added a commit that referenced this issue Oct 23, 2013

Merge pull request #1472 from padrino/fix-incorrect-params2
Skip the `:path_traversal` protection, fixes #1391.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment