diff --git a/changelog.d/hackney-http1.fix b/changelog.d/hackney-http1.fix new file mode 100644 index 000000000..a657ed2b0 --- /dev/null +++ b/changelog.d/hackney-http1.fix @@ -0,0 +1 @@ +Hackney: use HTTP/1.1 only, so closing one media proxy response no longer breaks other downloads from the same host \ No newline at end of file diff --git a/config/config.exs b/config/config.exs index e2c110689..ec176df1d 100644 --- a/config/config.exs +++ b/config/config.exs @@ -163,6 +163,10 @@ config :mime, :types, %{ config :tesla, adapter: Tesla.Adapter.Hackney +# Hackney 4 shares one HTTP/2 connection per host, and closing one response +# (as the media proxy does) stops it for every other stream on it. +config :hackney, default_protocols: [:http1] + # Configures http settings, upstream proxy etc. config :pleroma, :http, proxy_url: nil, diff --git a/test/pleroma/http/adapter_helper/hackney_test.exs b/test/pleroma/http/adapter_helper/hackney_test.exs index 22fcc93d1..2bda8165c 100644 --- a/test/pleroma/http/adapter_helper/hackney_test.exs +++ b/test/pleroma/http/adapter_helper/hackney_test.exs @@ -13,6 +13,12 @@ defmodule Pleroma.HTTP.AdapterHelper.HackneyTest do {:ok, uri: uri} end + # Hackney 4 shares one HTTP/2 connection per host, and closing a response + # stops that connection for every stream on it. + test "Hackney only speaks HTTP/1.1" do + assert :hackney_util.default_protocols() == [:http1] + end + describe "options/2" do setup do: clear_config([:http, :adapter], a: 1, b: 2)