Both found by porting homepage, which is the first service to raise a
redirect from a dependency and the first with a language switcher that
returns you to the page you were on.
A dependency saying "you are not logged in, go here" raises rather than
returns, because it has no other way to stop the request. The error handler
treated every HTTPException as something to render, so a 307 came back
carrying the themed error page and no Location at all - a redirect that
does not redirect, with a 307 status to make it look like it had. Now a 3xx
with a Location is passed through as one.
chrome's /language/{code} already existed and took the destination from
Referer. homepage's own version additionally honoured ?next=, and chrome's
route shadowed it - so the feature silently disappeared on adoption rather
than conflicting visibly. The parameter moves into chrome instead, with the
open-redirect guard homepage had: anything carrying a scheme or a host is
discarded rather than patched up, including the protocol-relative
`//evil.example/x`, which urlparse reports as a netloc with no scheme and
which a naive `startswith("/")` check waves through.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
35 lines
895 B
TOML
35 lines
895 B
TOML
[project]
|
|
name = "chrome"
|
|
version = "0.4.0"
|
|
description = "Shared page shell, design tokens and service helpers for the internal services."
|
|
requires-python = ">=3.13"
|
|
dependencies = [
|
|
"fastapi>=0.115",
|
|
"jinja2>=3.1",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = ["pytest>=8", "httpx>=0.27", "uvicorn[standard]>=0.30"]
|
|
|
|
[build-system]
|
|
requires = ["setuptools>=68"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[tool.setuptools.packages.find]
|
|
include = ["chrome*"]
|
|
|
|
# The shell is useless without its templates and static tree, and a wheel
|
|
# carries only .py files unless told otherwise. scribe shipped a broken wheel
|
|
# this way once; the container worked only because uvicorn imported from the
|
|
# source tree.
|
|
[tool.setuptools.package-data]
|
|
chrome = [
|
|
"templates/*.html",
|
|
"static/*.css",
|
|
"static/*.js",
|
|
"static/vendor/*",
|
|
"static/wa/**/*",
|
|
]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|