rust-cgi icon indicating copy to clipboard operation
rust-cgi copied to clipboard

[Suggestion] Use "REQUEST_PATH" Instead of "SCRIPT_NAME" to Get Requested URI

Open loloicci opened this issue 5 years ago • 2 comments

I suggest using REQUEST_PATH instead of SCRIPT_NAME to get requested URI in parse_request.

https://github.com/rory/rust-cgi/blob/269b6680b84bc2645e89ec144f31bbc8b7a4bb2a/src/lib.rs#L235-L240

When the server uses mod_rewrite and rewrite requested URI:

  • If we use SCRIPT_NAME to get URI, the requested URI before rewriting is lost.
  • If we use REQUEST_PATH to get URI, gotten URI is the same one before rewriting.

loloicci avatar May 22 '20 19:05 loloicci

I'll have to read the CGI & HTTP to figure this out. I'd rather follow those specs. I don't know off the top of my head

amandasaurus avatar May 25 '20 19:05 amandasaurus

Thank you @rory . If you will decide not to change, could you discuss fix parse_request to return REQUEST_PATH in another way?

loloicci avatar May 27 '20 11:05 loloicci