Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

HTTP20Connection: Fix use of ENABLE_PUSH #402

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hyper/http20/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""
import h2.connection
import h2.events
import h2.settings
from h2.settings import SettingCodes

from ..compat import ssl
from ..tls import wrap_socket, H2_NPN_PROTOCOLS, H2C_PROTOCOL
Expand Down Expand Up @@ -403,7 +403,7 @@ def _connect_upgrade(self, sock):
with self._conn as conn:
conn.initiate_upgrade_connection()
conn.update_settings(
{h2.settings.ENABLE_PUSH: int(self._enable_push)}
{SettingCodes.ENABLE_PUSH: int(self._enable_push)}
)
self._send_outstanding_data()

Expand All @@ -424,7 +424,7 @@ def _send_preamble(self):
with self._conn as conn:
conn.initiate_connection()
conn.update_settings(
{h2.settings.ENABLE_PUSH: int(self._enable_push)}
{SettingCodes.ENABLE_PUSH: int(self._enable_push)}
)
self._send_outstanding_data()

Expand Down
5 changes: 2 additions & 3 deletions test/test_hyper.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import h2.settings

from h2.frame_buffer import FrameBuffer
from h2.connection import ConnectionState
from h2.settings import SettingCodes
from hyperframe.frame import (
Frame, DataFrame, RstStreamFrame, SettingsFrame, PushPromiseFrame,
WindowUpdateFrame, HeadersFrame, ContinuationFrame, GoAwayFrame,
Expand Down Expand Up @@ -766,7 +765,7 @@ def test_incrementing_window_after_close(self):
# the default max frame size (16,384 bytes). That will, on the third
# frame, trigger the processing to increment the flow control window,
# which should then not happen.
f = SettingsFrame(0, settings={h2.settings.INITIAL_WINDOW_SIZE: 100})
f = SettingsFrame(0, settings={SettingCodes.INITIAL_WINDOW_SIZE: 100})

c = HTTP20Connection('www.google.com')
c._sock = DummySocket()
Expand Down