aboutsummaryrefslogtreecommitdiffstats
path: root/proxy/utils.py
blob: 3fff3885d417a171f58daf857cf96c3ab4817b44 (plain)
1
2
3
4
5
6
7
8
9
10
11
from starlette.requests import HTTPConnection


def get_path_with_query_string(connection: HTTPConnection) -> str:
    path = connection.url.path
    query_string = (
        "?" + connection.scope["query_string"].decode()
        if connection.scope["query_string"]
        else ""
    )
    return f"{path}{query_string}"