New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove HTTP/2 Push Promise support since Plug is deprecating it #33
Conversation
Can't we get rid of the Alternatively if you want to keep the frame, it can be an empty struct since the fields aren't used anyway (as far as I can see). If we want to ignore invalid WDYT? Edit: And the |
Sadly we cannot, since a number of tests in h2spec require us to handle push frames in a specific way (even if we don't support them). We can drop the deserialization down to a single error clause though, since all of the failure cases in the spec resolve down to the same error (protocol error, close connection). We will need to keep the deserialize function around, but no longer need to have a struct definition for PushPromise.
✅ thanks! |
Updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one little thing.
Otherwise it looks good!
lib/bandit/http2/frame/settings.ex
Outdated
@@ -33,10 +33,10 @@ defmodule Bandit.HTTP2.Frame.Settings do | |||
{:cont, {:ok, %{acc | header_table_size: value}}} | |||
|
|||
{:ok, {0x02, 0x01}}, {:ok, acc} -> | |||
{:cont, {:ok, %{acc | enable_push: true}}} | |||
{:cont, {:ok, acc}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove these cases all together (and ignore invalid enable_push
values)?
h2spec
seems fine with it.
Otherwise group the valid cases to {:ok, {0x02, val}}, {:ok, acc} when val in [0x00, 0x01] ->
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep the handling, even if h2spec doesn't complain. No sense in walking back strict conformance.
Updated to use a when clause, as suggested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe use {:ok, {0x02, value}}, {:ok, _acc} when value not in [0x00, 0x01]
on the error case and drop the noop case?
This should have actually come out as part of #33 but was missed
This should have actually come out as part of #33 but was missed
See elixir-plug/plug@cd258e7
@moogle19 you've had a lot of eyes here lately; care to give this a once over?