Files
Dannon Baker 75c01f39a6 Bound and sanitize lift-status response headers
Drop the aggregate lift headers from the unprivileged tools index
endpoint entirely -- an aggregate across all of a user's tools is
unbounded, has no per-tool attribution, and the same information is
already in the response body per tool. The single-tool endpoints keep
their headers (raw_tool_source has no other channel, the body is the
tool source itself) but dedupe and cap them at 20 entries and a hard
1KB byte bound with a '+N more' suffix, and the Warning header no
longer duplicates the whole list -- it just carries the count and
points at the X-Galaxy-* header. Error paths embed stored dict keys,
so control characters and non-ASCII are replaced and the ends are
stripped before emission; that closes a header-injection hole, keeps
h11 from rejecting a value that starts or ends with a space, and makes
len() the encoded byte length. The helpers live in api/common.py since
both dynamic_tools and the legacy tools controller use them. The
integration tests also cover raw_tool_source, the invalid path on show,
and a stored key with a trailing space.
2026-11-05 11:39:58 -05:00
..
2024-01-08 11:33:29 +01:00
2024-01-08 11:33:44 +01:00