PATH_INFO trailing slashes are stripped #81
Comments
I have this same problem. |
|
env['PATH_INFO'] does not give the same output as env['REQUEST_URI'] For instance, in my specific use case, my url may be http://example.com/foo/bar/ (with a trailing slash). env["REQUEST_URI'] == '/foo/bar/' (with trailing slash) while env['PATH_INFO'] == '/foo/bar' (no trailing slash) Any idea how to get the actual full URL value from env including the trailing slash if REQUEST_URI is not universally supported?
|
Made my point,
Also see: https://github.com/rack/rack/blob/master/lib/rack/request.rb#L271 |
I'm not arguing the inconsistency of REQUEST_URI, I agree with you. Just curious as to how to get the true path of the URL. PATH_INFO, #fullpath, and #path all strip off the trailing slash. So it appears there is no possible way (via env or otherwise) to get the fullpath including trailing slash from rack? see attached debug screenshot as well: http://cl.ly/2o1d3B2t1K3Y3d1k1e0p |
Hrm, maybe this a issue with nodejs. I'm just using whatever it gives me as the path. |
ok, thx. I'll take this over to node.js and file a ticket there |
Where the magic happens: https://github.com/josh/nack/blob/master/src/client.coffee#L182-185 |
This looks correct though:
|
We should figure out where this is actually happening. |
So, I'm not sure I follow to this point. Do you think its a node.js issue that I should file a ticket there or is this related to the nack source?
|
I'll be more than happy to help out as I can since I filed the ticket, but my node experience to date is very minimal (read nearly non-existent) so I'm not sure where to even begin.
|
I wouldn't file a ticket until we are sure thats the issue. |
Node's server seems to be correct:
|
I tested this while running on the thin server as well and get the same output that I am getting from Pow/Nack So, is it the case that PATH_INFO is not very well standardized as well, just like REQUEST_URI
|
I actually can't reproduce here. Can you try starting an example rails app. It could be some stuff in your stack mutating the |
Ok, I'll try to reproduce at the barest level as possible on my end. Just to clarify, you are running via Pow and a url in the format /foo/bar/ is returning the correct "/foo/bar/" string for PATH_INFO, correct?
|
pow doesnt seem to be setting the REQUEST_URI request.env variable for rails apps.
thin sets this request.env var, but running the app under pow does not
The text was updated successfully, but these errors were encountered: