pleroma/test
Lain Soykaf 0615025f92
fix(http): enforce max_body again under Hackney 4
Hackney 4 ignores `with_body` and always returns a fully read binary, so
Tesla.Adapter.Hackney never reaches the clause that honours :max_body and
the option became a no-op. Only the gun path still enforced it, through
Pleroma.HTTP.Adapter.Gun. Pleroma.Web.RelMe relies on nothing else, so it
was fetching remote pages unbounded.

Add a middleware that applies the limit for every adapter: reject when
content-length already announces too much, and reject a body that came
back over the limit. Streaming bodies are left alone -- neither adapter
limits those and the caller owns the lease, so failing here on the header
would strand a connection RichMedia is still expected to release.

On the hackney path this bounds what callers are handed rather than peak
memory, since the adapter has read the body before any middleware runs.
2026-07-26 09:29:36 +04:00
..
config
credo/check/consistency Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
fixtures Normalize Hubzilla alsoKnownAs from string to array 2026-02-12 18:47:22 +01:00
instance_static
mix Lint 2026-07-18 16:13:39 +02:00
pleroma fix(http): enforce max_body again under Hackney 4 2026-07-26 09:29:36 +04:00
support Revert "Only warn about bad clear_config usage if warned usage is met" 2026-07-19 22:15:37 +02:00
test_helper.exs Elixir 1.18 Deal with :warnings_as_errors deprecation in compiler_options/1 2025-05-13 14:02:47 +02:00