Skip to content

Commit a9b114d

Browse files
authored
Fix handling for non-root path URLs (#23)
1 parent c379c4d commit a9b114d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bokeh_fastapi/application.py

+4
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,10 @@ def sign_sessions(self) -> bool:
342342
def resources(self, absolute_url: str | None = None) -> Resources:
343343
mode = settings.resources(default="server")
344344
if mode == "server":
345+
if absolute_url is True:
346+
absolute_url = self.app.root_path
347+
if absolute_url is None or absolute_url is False:
348+
absolute_url = "/"
345349
root_url = (
346350
urljoin(absolute_url, self._prefix) if absolute_url else self._prefix
347351
)

0 commit comments

Comments
 (0)