google-code-export / v8cgi

Automatically exported from code.google.com/p/v8cgi
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

scripts can't make use of PATH_INFO #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a test.sjs file in the DOCUMENT_ROOT containing
response.write (HTML.dump(request));

2. Browse to http://server/test.sjs/123

What is the expected output? What do you see instead?
Expect: a dump of the request object with _headers.PATH_INFO set to "/123"
Get: Empty document, error in log:
  Cannot find '/s1/www/roots/dev.adjustablelabs.info/moo'

What version of the product are you using? On what operating system?
0.7.0, Ubuntu 8.04 

Please provide any additional information below.
In v8cgi_App::findmain() SCRIPT_FILENAME should be favored over
PATH_TRANSLATED when finding the script file, not vice versa.  Otherwise
PATH_INFO can't work.

Original issue reported on code.google.com by shinydis...@gmail.com on 14 Nov 2009 at 9:57

GoogleCodeExporter commented 9 years ago

Original comment by ondrej.zara on 14 Nov 2009 at 2:47

GoogleCodeExporter commented 9 years ago
This stuff seems to be very complex. With the following Apache config:

ScriptAlias /v8cgi/ /path/to/v8cgi/directory/
AddHandler v8cgi-handler .ssjs
Action v8cgi-handler /v8cgi/v8cgi

A request to "/index.ssjs" has these env vars:
PATH_TRANSLATED: /physical/path/to/webserver/root/index.ssjs
SCRIPT_FILENAME: /path/to/v8cgi/directory/v8cgi

In this scenario, PATH_TRANSLATED should be therefore preferred...

Original comment by ondrej.zara on 15 Nov 2009 at 4:48

GoogleCodeExporter commented 9 years ago
Sorry, I should have said I used mod_v8cgi and did not use either external v8cgi
executable.  Where to get the path does depend on whether it runs as a module 
or as a
handler.

Original comment by shinydis...@gmail.com on 15 Nov 2009 at 8:30

GoogleCodeExporter commented 9 years ago
Aha, ok. Please try the latest SVN revision; the code handling this was 
significantly
changed and Apache module does not use PATH_TRANSLATED nor SCRIPT_FILENAME 
anymore.
This will be include in 0.7.5, which is going to be released in few days...

Original comment by ondrej.zara on 15 Nov 2009 at 10:00

GoogleCodeExporter commented 9 years ago
mod_v8cgi from the trunk works properly... many thanks!

Original comment by shinydis...@gmail.com on 15 Nov 2009 at 10:13

GoogleCodeExporter commented 9 years ago

Original comment by ondrej.zara on 16 Nov 2009 at 6:50