| | 242 | |
|---|
| | 243 | def parseFirstLine(self): |
|---|
| | 244 | # This has to be done very early in the request process, |
|---|
| | 245 | # because request.path is used for config lookups right away. |
|---|
| | 246 | req = cherrypy.request |
|---|
| | 247 | |
|---|
| | 248 | # Parse first line |
|---|
| | 249 | req.method, path, req.protocol = req.requestLine.split() |
|---|
| | 250 | req.processRequestBody = req.method in ("POST", "PUT") |
|---|
| | 251 | |
|---|
| | 252 | # separate the queryString, or set it to "" if not found |
|---|
| | 253 | if "?" in path: |
|---|
| | 254 | path, req.queryString = path.split("?", 1) |
|---|
| | 255 | else: |
|---|
| | 256 | path, req.queryString = path, "" |
|---|
| | 257 | |
|---|
| | 258 | # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2 |
|---|
| | 259 | if path == "*": |
|---|
| | 260 | path = "global" |
|---|
| | 261 | elif not path.startswith("/"): |
|---|
| | 262 | # path is an absolute path (including "http://host.domain.tld"); |
|---|
| | 263 | # convert it to a relative path, so configMap lookups work. This |
|---|
| | 264 | # default method assumes all hosts are valid for this server. |
|---|
| | 265 | scheme, location, p, pm, q, f = urlparse(path) |
|---|
| | 266 | path = path[len(scheme + "://" + location):] |
|---|
| | 267 | |
|---|
| | 268 | # Save original value (in case it gets modified by filters) |
|---|
| | 269 | req.path = req.originalPath = path |
|---|
| | 270 | |
|---|
| | 271 | # Change objectPath in filters to change |
|---|
| | 272 | # the object that will get rendered |
|---|
| | 273 | req.objectPath = None |
|---|
| 277 | | def parseFirstLine(self): |
|---|
| 278 | | # This has to be done very early in the request process, |
|---|
| 279 | | # because request.path is used for config lookups right away. |
|---|
| 280 | | req = cherrypy.request |
|---|
| 281 | | |
|---|
| 282 | | # Parse first line |
|---|
| 283 | | req.method, path, req.protocol = req.requestLine.split() |
|---|
| 284 | | req.processRequestBody = req.method in ("POST", "PUT") |
|---|
| 285 | | |
|---|
| 286 | | # separate the queryString, or set it to "" if not found |
|---|
| 287 | | if "?" in path: |
|---|
| 288 | | path, req.queryString = path.split("?", 1) |
|---|
| 289 | | else: |
|---|
| 290 | | path, req.queryString = path, "" |
|---|
| 291 | | |
|---|
| 292 | | # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2 |
|---|
| 293 | | if path == "*": |
|---|
| 294 | | path = "global" |
|---|
| 295 | | elif not path.startswith("/"): |
|---|
| 296 | | # path is an absolute path (including "http://host.domain.tld"); |
|---|
| 297 | | # convert it to a relative path, so configMap lookups work. This |
|---|
| 298 | | # default method assumes all hosts are valid for this server. |
|---|
| 299 | | scheme, location, p, pm, q, f = urlparse(path) |
|---|
| 300 | | path = path[len(scheme + "://" + location):] |
|---|
| 301 | | |
|---|
| 302 | | # Save original value (in case it gets modified by filters) |
|---|
| 303 | | req.path = req.originalPath = path |
|---|
| 304 | | |
|---|