Skip to content

Commit 70c18b3

Browse files
committed
better handle URL path when app if proxied
1 parent 34ff283 commit 70c18b3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release Notes
22

3+
## Unreleased
4+
5+
### titiler.application
6+
7+
* fix invalid url parsing in HTML responses
8+
39
## 0.17.0 (2024-01-17)
410

511
### titiler.core

src/titiler/application/titiler/application/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""titiler app."""
22

33
import logging
4+
import re
45

56
import jinja2
67
from fastapi import Depends, FastAPI, HTTPException, Security
@@ -245,6 +246,8 @@ def landing(request: Request):
245246
}
246247

247248
urlpath = request.url.path
249+
if root_path := request.app.root_path:
250+
urlpath = re.sub(r"^" + root_path, "", urlpath)
248251
crumbs = []
249252
baseurl = str(request.base_url).rstrip("/")
250253

0 commit comments

Comments
 (0)