(requests_pathname, path)
| 74 | |
| 75 | |
| 76 | def app_get_relative_path(requests_pathname, path): |
| 77 | if requests_pathname == "/" and path == "": |
| 78 | return "/" |
| 79 | if requests_pathname != "/" and path == "": |
| 80 | return requests_pathname |
| 81 | if not path.startswith("/"): |
| 82 | raise exceptions.UnsupportedRelativePath( |
| 83 | f""" |
| 84 | Paths that aren't prefixed with a leading / are not supported. |
| 85 | You supplied: {path} |
| 86 | """ |
| 87 | ) |
| 88 | return "/".join([requests_pathname.rstrip("/"), path.lstrip("/")]) |
| 89 | |
| 90 | |
| 91 | def strip_relative_path(path): |
no outgoing calls
searching dependent graphs…