rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
* Does Rack SPEC states that PATH_INFO must be cut after ";" (semicolon)?
@ 2009-11-24 18:22 Iñaki Baz Castillo
  2009-11-30 16:27 ` Iñaki Baz Castillo
  0 siblings, 1 reply; 9+ messages in thread
From: Iñaki Baz Castillo @ 2009-11-24 18:22 UTC (permalink / raw)
  To: Rack Development

Hi, I've reported an issue for Thin HTTP server since it cuts PATH_INFO after 
finding a ";":

  http://github.com/macournoyer/thin/issues/closed/#issue/6

---------------------------
If Thin receives a request with request line:

 GET /level1/level2;user=alice/level3/doc.txt HTTP/1.1

then Thin cuts the URI path and leaves:
 env{"PATH_INFO"} => "/level1/level2"

Why? I've looked for such behavior in RFC 3986 and RFC 2616 but I don't find a 
reason to remove all the path content after ";".
---------------------------


A Thin developer closed the bug with the argument:

----------------------------
the env object is constructed according to Rack specs: 
http://rack.rubyforge.org/doc/SPEC.html
If you want the full URI look into env["REQUEST_URI"]
----------------------------


However I don't find in the SPEC where the PATH_INFO must be cut before the 
first semicolon char.

I expect that is not correct at all since if ";" appears in the PATH (I mean 
before the query) then it's a valid char for the PATH.

In fact this issue is breaking my application since Rack receives requests 
containing ";" in the path like:

  GET /app/user%25b@id=%22ibc@domain.org;nat=yes%22%2d

which after hex-unescaping becomes:

  GET /app/user[@id="ibc@domain.org;nat=yes"]

Thin (and Mongrel) creates PATH_INFO as follows:

  /app/user%25b@id=%22ibc@domain.org


A workaround is forcing the client to escape the semicolon, but this violates 
the application specs as ";" is not required to be encoded in the HTTP uri (it 
could be encoded or not, but it's not required).


IMHO it's a bug in Rack SPEC (even if I don't find that point) or in 
Thin/Mongrel implementation.

Thanks a lot for any comment.


-- 
Iñaki Baz Castillo <ibc@aliax.net>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-12-07 13:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-24 18:22 Does Rack SPEC states that PATH_INFO must be cut after ";" (semicolon)? Iñaki Baz Castillo
2009-11-30 16:27 ` Iñaki Baz Castillo
2009-11-30 23:31   ` Hongli Lai
2009-12-01  0:42     ` Iñaki Baz Castillo
2009-12-05 22:54       ` Scytrin dai Kinthra
2009-12-05 23:15         ` Iñaki Baz Castillo
2009-12-07  2:32           ` Eric Wong
2009-12-07  9:53             ` Iñaki Baz Castillo
     [not found]   ` <8108c6090912061939h7f2ae70rac675219ed08f2e8@mail.gmail.com>
2009-12-07 11:08     ` masayoshi takahashi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).