docs(http): update hackney comments for 4.9

This commit is contained in:
Lain Soykaf 2026-10-26 22:02:41 +04:00
commit 26486b041b
No known key found for this signature in database
3 changed files with 14 additions and 17 deletions

View file

@ -14,16 +14,15 @@
#
# Pleroma cannot work around this: since 4.0 Hackney ignores `with_body` and
# always returns a fully read binary, so a synchronous request never yields a
# handle to close. Up to 4.8 a truncated read also reported `{:ok, body}`;
# since 4.9 it is `{:error, {:closed, partial_body}}`.
# handle to close. Up to 4.8.2 a truncated read also reported `{:ok, body}`;
# since 4.8.3 it is `{:error, {:closed, partial_body}}`.
#
# Media proxy warming hits this whenever an attachment fetch is cut short and
# the outbound proxy is used as a CONNECT tunnel, since tunnels are never
# pooled. That is how it was found.
#
# Fixed upstream by https://github.com/benoitc/hackney/pull/919; mix.exs pins
# that commit until it lands in a release. Should this start failing, the pin
# has been moved to a version without the fix.
# Fixed upstream by https://github.com/benoitc/hackney/pull/919. Should this
# start failing, mix.exs has moved to a Hackney version without the fix.
#
# https://github.com/benoitc/hackney/issues/918
defmodule Pleroma.HTTP.HackneyConnLeakTest do

View file

@ -44,8 +44,8 @@ defmodule Pleroma.HTTP.HackneyMaxBodyRegressionTest do
request("#{server.base_url}/big", max_body: 1024)
end
# Without a Content-Length the header pre-check cannot fire, so this is the
# case that proves hackney's fully-read binary is measured.
# Without a Content-Length the header pre-check cannot fire, so only a size
# check on the body can refuse this.
test "a chunked body over max_body is refused on size alone", %{server: server} do
assert {:error, :body_too_large} =
request("#{server.base_url}/chunked", max_body: 1024)
@ -58,7 +58,7 @@ defmodule Pleroma.HTTP.HackneyMaxBodyRegressionTest do
assert byte_size(body) == @body_bytes
end
test "without max_body the body is returned whatever its size", %{server: server} do
test "without max_body the body is returned", %{server: server} do
assert {:ok, %Tesla.Env{status: 200, body: body}} = request("#{server.base_url}/big", [])
assert byte_size(body) == @body_bytes
end