(request)
| 655 | return path |
| 656 | |
| 657 | def request_port(request): |
| 658 | host = request.host |
| 659 | i = host.find(':') |
| 660 | if i >= 0: |
| 661 | port = host[i+1:] |
| 662 | try: |
| 663 | int(port) |
| 664 | except ValueError: |
| 665 | _debug("nonnumeric port: '%s'", port) |
| 666 | return None |
| 667 | else: |
| 668 | port = DEFAULT_HTTP_PORT |
| 669 | return port |
| 670 | |
| 671 | # Characters in addition to A-Z, a-z, 0-9, '_', '.', and '-' that don't |
| 672 | # need to be escaped to form a valid HTTP URL (RFCs 2396 and 1738). |
no test coverage detected