Skip to content

Commit

Permalink
better handle URL path when app if proxied
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Jan 19, 2024
1 parent 34ff283 commit 70c18b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes

## Unreleased

### titiler.application

* fix invalid url parsing in HTML responses

## 0.17.0 (2024-01-17)

### titiler.core
Expand Down
3 changes: 3 additions & 0 deletions src/titiler/application/titiler/application/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""titiler app."""

import logging
import re

import jinja2
from fastapi import Depends, FastAPI, HTTPException, Security
Expand Down Expand Up @@ -245,6 +246,8 @@ def landing(request: Request):
}

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

Expand Down

0 comments on commit 70c18b3

Please sign in to comment.