Skip to content

Commit

Permalink
Remove deprecated http2 push tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Sep 9, 2024
1 parent 746d848 commit a1e2acb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
1 change: 0 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ defmodule Plug.Cowboy.MixProject do
{:cowboy_telemetry, "~> 0.3"},
{:ex_doc, "~> 0.20", only: :docs},
{:hackney, "~> 1.2", only: :test},
{:kadabra, "0.3.4", only: :test},
{:x509, "~> 0.6", only: :test}
]
end
Expand Down
2 changes: 0 additions & 2 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
"ex_doc": {:hex, :ex_doc, "0.31.2", "8b06d0a5ac69e1a54df35519c951f1f44a7b7ca9a5bb7a260cd8a174d6322ece", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.1", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "317346c14febaba9ca40fd97b5b5919f7751fb85d399cc8e7e8872049f37e0af"},
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
"hpack": {:hex, :hpack_erl, "0.2.3", "17670f83ff984ae6cd74b1c456edde906d27ff013740ee4d9efaa4f1bf999633", [:rebar3], [], "hexpm", "06f580167c4b8b8a6429040df36cc93bba6d571faeaec1b28816523379cbb23a"},
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
"kadabra": {:hex, :kadabra, "0.3.4", "677d0c5d28a016c7dec167b3f969fe72b4bf18e9568a399cc262efa1ef124925", [:mix], [{:hpack, "~> 0.2.3", [hex: :hpack_erl, repo: "hexpm", optional: false]}, {:scribe, "~> 0.4", [hex: :scribe, repo: "hexpm", optional: true]}], "hexpm", "b6ba901a42095e2f99f54a5114c48920999439f43c6cc77d6f9029f7e9a0d222"},
"makeup": {:hex, :makeup, "1.1.1", "fa0bc768698053b2b3869fa8a62616501ff9d11a562f3ce39580d60860c3a55e", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "5dc62fbdd0de44de194898b6710692490be74baa02d9d108bc29f007783b0b48"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.5", "e0ff5a7c708dda34311f7522a8758e23bfcd7d8d8068dc312b5eb41c6fd76eba", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "94d2e986428585a21516d7d7149781480013c56e30c6a233534bedf38867a59a"},
Expand Down
31 changes: 0 additions & 31 deletions test/plug/cowboy/conn_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ defmodule Plug.Cowboy.ConnTest do
]

setup_all do
{:ok, _} = Application.ensure_all_started(:kadabra)
{:ok, _} = Plug.Cowboy.http(__MODULE__, [], port: 8003, protocol_options: @protocol_options)
{:ok, _} = Plug.Cowboy.https(__MODULE__, [], @https_options)

Expand Down Expand Up @@ -659,36 +658,6 @@ defmodule Plug.Cowboy.ConnTest do
end
end

test "http2 response" do
{:ok, pid} = Kadabra.open(~c"localhost", :https, @http2_opts)
Kadabra.get(pid, "/http2")

assert_receive({:end_stream, %Kadabra.Stream.Response{body: "HTTP/2", status: 200}}, 1_000)
end

test "http2 early hints" do
{:ok, pid} = Kadabra.open(~c"localhost", :https, @http2_opts)
Kadabra.get(pid, "/http2?earlyhints=true")
assert_receive({:end_stream, %Kadabra.Stream.Response{headers: headers}})
assert {"link", "</style.css>; rel=preload; as=style"} in headers
end

test "http2 server push" do
{:ok, pid} = Kadabra.open(~c"localhost", :https, @http2_opts)
Kadabra.get(pid, "/http2")
assert_receive({:push_promise, %Kadabra.Stream.Response{headers: headers}})
assert {"accept", "text/css"} in headers
assert {":path", "/static/assets.css"} in headers
end

test "http2 server push without automatic mime type" do
{:ok, pid} = Kadabra.open(~c"localhost", :https, @http2_opts)
Kadabra.get(pid, "/http2?noinfer=true")
assert_receive({:push_promise, %Kadabra.Stream.Response{headers: headers}})
assert {"accept", "text/plain"} in headers
assert {":path", "/static/assets.css"} in headers
end

def peer_data(conn) do
assert conn.scheme == :https
%{address: address, port: port, ssl_cert: ssl_cert} = get_peer_data(conn)
Expand Down

0 comments on commit a1e2acb

Please sign in to comment.