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

When using request absolute URI Thin leaves PATH_INFO empty #8

Closed
ibc opened this issue Dec 14, 2009 · 6 comments
Closed

When using request absolute URI Thin leaves PATH_INFO empty #8

ibc opened this issue Dec 14, 2009 · 6 comments

Comments

@ibc
Copy link

ibc commented Dec 14, 2009

I'm testing Rack with Thin 1.2.5 using both HTTP queries with relative URI and absolute URI.
I use map "/" in my Rack builder so it gets any request.

However when I get the value of env["PATH_INFO"] I get an empty string when using absolute URI:

a) Relative URI:

GET /pres-rules/mydoc.xml HTTP/1.1

=> env['PATH_INFO'] = "/pres-rules/mydoc.xml"

b) Absolute URI:

GET http://127.0.0.1:9292/pres-rules/mydoc.xml HTTP/1.1

=> env['PATH_INFO'] = ""

This doesn't occur using webrick.

PS: As per RFC 2616 (HTTP/1.1) a HTTP request allows absolute request uri:
http://tools.ietf.org/html/rfc2616#section-5.1.2

GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1
@macournoyer
Copy link
Owner

Indeed, it's a known bug (or unsupported feature if you will). Web browsers never use absolute urls so it's an edge case. Why are you sending this request?

@ibc
Copy link
Author

ibc commented Dec 16, 2009

Thanks for the response. I don't use Thin for web applications but for XCAP (RFC 4825) which is XPath over HTTP (more or less). It's still a new protocol and I don't know if vendors will implement relative or absolute URI's in the HTTP requests (I expect they will always use relative uri however).

So I have seen no http client using absolute uri yet.

@scomma
Copy link

scomma commented Nov 7, 2012

I can't believe nobody else runs into this problem when using thin in conjunction with the proxy.pac file?! In which case Rails ends up serving the root page to all requests (including assets).

Started GET "" for 127.0.0.1 at 2012-11-08 02:36:45 +0700
Processing by PagesController#show as */*
  Parameters: {"id"=>"home"}
  Rendered pages/home.html.erb within layouts/application (0.0ms)
Completed 200 OK in 33ms (Views: 33.1ms | ActiveRecord: 0.0ms)


Started GET "" for 127.0.0.1 at 2012-11-08 02:36:45 +0700
Processing by PagesController#show as */*
  Parameters: {"id"=>"home"}
  Rendered pages/home.html.erb within layouts/application (0.0ms)
Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)


Started GET "" for 127.0.0.1 at 2012-11-08 02:36:45 +0700
Processing by PagesController#show as HTML
  Parameters: {"id"=>"home"}
  Rendered pages/home.html.erb within layouts/application (0.0ms)
Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms)


Started GET "" for 127.0.0.1 at 2012-11-08 02:36:45 +0700
Processing by PagesController#show as */*
  Parameters: {"id"=>"home"}
  Rendered pages/home.html.erb within layouts/application (0.0ms)
Completed 200 OK in 5ms (Views: 5.2ms | ActiveRecord: 0.0ms)

@jorgemanrubia
Copy link

I experienced this issue too.

@macournoyer
Copy link
Owner

It should be fixed on v2 branch or gem install thin --pre if you want to give it a try.

@jorgemanrubia
Copy link

Thanks @macournoyer. I will try

@ioquatix ioquatix closed this as completed Sep 7, 2020
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

No branches or pull requests

5 participants