Skip to content

Commit

Permalink
Merge pull request #153 from stac-utils/patch/fix-url-parsing-html-te…
Browse files Browse the repository at this point in the history
…mplate

better handle URL path when app if proxied
  • Loading branch information
vincentsarago authored Jan 19, 2024
2 parents 7c798f0 + 114111c commit 8208cf7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 1.2.1 (2024-01-19)

* fix invalid url parsing in HTML responses

## 1.2.0 (2024-01-17)

* update titiler requirement to `>=0.17.0,<0.18`
Expand Down
3 changes: 3 additions & 0 deletions titiler/pgstac/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""TiTiler+PgSTAC FastAPI application."""

import logging
import re
from contextlib import asynccontextmanager
from typing import Dict

Expand Down Expand Up @@ -265,6 +266,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 8208cf7

Please sign in to comment.