Skip to content

Commit

Permalink
Implement no-op support for Plug.Conn.Adapter.upgrade/3
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrudel committed Oct 3, 2022
1 parent c06b6c8 commit 0646251
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/bandit/http1/adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ defmodule Bandit.HTTP1.Adapter do
@impl Plug.Conn.Adapter
def inform(_req, _status, _headers), do: {:error, :not_supported}

@impl Plug.Conn.Adapter
def upgrade(_req, _upgrade, _opts), do: {:error, :not_supported}

@impl Plug.Conn.Adapter
def push(_req, _path, _headers), do: {:error, :not_supported}

Expand Down
3 changes: 3 additions & 0 deletions lib/bandit/http2/adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ defmodule Bandit.HTTP2.Adapter do
GenServer.call(adapter.connection, {:send_headers, adapter.stream_id, headers, false})
end

@impl Plug.Conn.Adapter
def upgrade(_req, _upgrade, _opts), do: {:error, :not_supported}

@impl Plug.Conn.Adapter
def push(adapter, path, headers) do
headers = split_cookies(headers)
Expand Down

0 comments on commit 0646251

Please sign in to comment.