Skip to content

Commit 4ab75eb

Browse files
committed
subpath forwarding
1 parent e3781fa commit 4ab75eb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

server/src/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
# ==============================================================================
2121
DATABASE_ADAPTER_IP = os.getenv("DATABASE_ADAPTER_IP")
22+
SUBPATH = os.getenv("SUBPATH", "/api/access")
2223

2324
# ==============================================================================
2425

@@ -130,7 +131,7 @@ def parse_to_int(s: str) -> int:
130131

131132

132133
async def _reverse_proxy(request: Request):
133-
url = httpx.URL(path=request.url.path,
134+
url = httpx.URL(path=request.url.path.replace(SUBPATH, "", 1),
134135
query=request.url.query.encode("utf-8"))
135136
rp_req = client.build_request(request.method, url,
136137
headers=request.headers.raw,

0 commit comments

Comments
 (0)