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