Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix ENABLE_PUSH
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Aug 21, 2024
1 parent c984257 commit 51c197f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hyper/http20/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
import threading
import itertools

try:
from h2.settings import ENABLE_PUSH
except ImportError:
from h2.settings import SettingCodes
ENABLE_PUSH = SettingCodes.ENABLE_PUSH

log = logging.getLogger(__name__)

DEFAULT_WINDOW_SIZE = 65535
Expand Down Expand Up @@ -403,7 +409,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)}
{ENABLE_PUSH: int(self._enable_push)}
)
self._send_outstanding_data()

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

Expand Down

0 comments on commit 51c197f

Please sign in to comment.