Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 4908:92757447dcf0 routing
Remove PATH_INFO hacks that strip leading slash
PATH_INFO should always start with '/' when not empty, see
http://tools.ietf.org/html/rfc3875#section-4.1.5
Instead, do leading slash stripping inside cgi.client
| author | anatoly techtonik <techtonik@gmail.com> |
|---|---|
| date | Wed, 16 Jul 2014 03:10:02 +0300 |
| parents | 48d93e98be7b |
| children | 35dc9191394d |
comparison
equal
deleted
inserted
replaced
| 4907:c37069a99cec | 4908:92757447dcf0 |
|---|---|
| 207 | 207 |
| 208 See inner_main for request processing. | 208 See inner_main for request processing. |
| 209 | 209 |
| 210 Client attributes at instantiation: | 210 Client attributes at instantiation: |
| 211 | 211 |
| 212 - "path" is the PATH_INFO inside the instance (with no leading '/') | 212 - "path" is the PATH_INFO inside the instance with stripped leading '/' |
| 213 - "base" is the base URL for the instance | 213 - "base" is the base URL for the instance |
| 214 - "form" is the cgi form, an instance of FieldStorage from the standard | 214 - "form" is the cgi form, an instance of FieldStorage from the standard |
| 215 cgi module | 215 cgi module |
| 216 - "additional_headers" is a dictionary of additional HTTP headers that | 216 - "additional_headers" is a dictionary of additional HTTP headers that |
| 217 should be sent to the client | 217 should be sent to the client |
| 292 self.env = env | 292 self.env = env |
| 293 self.setTranslator(translator) | 293 self.setTranslator(translator) |
| 294 self.mailer = Mailer(instance.config) | 294 self.mailer = Mailer(instance.config) |
| 295 | 295 |
| 296 # save off the path | 296 # save off the path |
| 297 self.path = env['PATH_INFO'] | 297 self.path = env['PATH_INFO'].lstrip('/') |
| 298 | 298 |
| 299 # this is the base URL for this tracker | 299 # this is the base URL for this tracker |
| 300 self.base = self.instance.config.TRACKER_WEB | 300 self.base = self.instance.config.TRACKER_WEB |
| 301 | 301 |
| 302 # should cookies be secure? | 302 # should cookies be secure? |
