Opened 12 years ago
Last modified 12 years ago
#257 closed defect (FIXED)
request.path_info sometimes used incorrectly
|Reported by:||Elrond||Owned by:||Christopher Allan Webber|
When running mediagoblin in a subpath, like /mediagoblin/, then some things are a little complex. For ``/mediagoblin/u/elrond/`` ``request.path_info`` becomes ``/u/elrond/``. - This is good, when trying to match routes. Simple, fine, job done. - This is BAD, when generating URLs like "request.path\_info + foo" for the browser, because the browser will only see ``/u/elrond/foo``. Which is wrong. Problem. I know, that the environ has SCRIPT\_NAME ("``/mediagoblin``" in this case), but it's not entirely clear, on how to procede from here. Assigning to Chris, as he created most of the base infrastructure and surely has comments.
Change History (8)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
One possible, simple way to help this issue: :: request.long_path = environ["SCRIPT_NAME"] + request.path_info # or request.long_path = environ["SCRIPT_URL"] And then ``request.long_path`` can be used in many places to mean the long, useful URL to reach the current page (without query params). In reality, I think, no places (except routing) need request.path\_info. So maybe it should be banned somehow?
comment:3 by , 12 years ago
Just to be sure, you changed how this was "mounted" via paste, is that correct? Or was it via fastcgi, or some other thing?
comment:4 by , 12 years ago
plain fastcgi: My main webserver serves my main site. And it redirects /mediagoblin/ via fcgi to GMG.
comment:5 by , 12 years ago
I volunteered to take care of this. Especially, as I understand the problem quite well and have an idea on how to fix it.
comment:6 by , 12 years ago
|Status:||New → Feedback|
Branch: misc/i592\_use\_full\_path Comments welcome!
comment:7 by , 12 years ago
|Milestone:||0.2.0 → 0.1.0|
|Status:||Feedback → Closed|
comment:8 by , 11 years ago
The original url for this bug was http://bugs.foocorp.net/issues/592 .
Note: See TracTickets for help on using tickets.