Skip to content

Clients should reject any attempt to change the SETTINGS_ENABLE_PUSH setting to a non-zero value #316

Description

@alexwlchan

RFC 7540 section 8.2:

Clients MUST reject any attempt to change the SETTINGS_ENABLE_PUSH setting to a value other than 0 by treating the message as a connection error (Section 5.4.1) of type PROTOCOL_ERROR.

If I’ve read this correctly, “attempt to change” means a SettingsFrame, yes?
If so, we don’t do this yet – indeed, there doesn’t seem to be a way for the h2.settings.Settings object to know if it’s for a client or server.

I’m not sure exactly when the Settings object gets configured – the user can specify the initial_values parameter, so presumably a client could have ENABLE_PUSH = 1 set by this way. The validation can’t occur on the Settings object, but we actually receive the frame, in H2Connection._receive_settings_frame().

That seems sub-optimal – it would be good to keep settings-specific logic in settings.py.

Perhaps we add a validate_received_setting() to mirror _validate_setting(), which is defined in settings.py but called in _receive_settings_frame(). This contains any additional checks for settings that come in via a SettingsFrame.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions