From d8d4a637f43ece7c370eb1e6a7ac0acf533cdcac Mon Sep 17 00:00:00 2001 From: jrconlin Date: Mon, 15 May 2017 09:19:18 -0700 Subject: [PATCH] This fix addresses an incompatibility with Chrome --- pywebpush/__init__.py | 6 ++---- pywebpush/tests/test_webpush.py | 2 +- requirements.txt | 2 +- setup.py | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pywebpush/__init__.py b/pywebpush/__init__.py index 55d4a8f..9bd8d8b 100644 --- a/pywebpush/__init__.py +++ b/pywebpush/__init__.py @@ -249,13 +249,11 @@ class WebPusher: # use ';' instead of ',' to append the headers. # see https://github.com/webpush-wg/webpush-encryption/issues/6 crypto_key += ';' - crypto_key += ( - "keyid=p256dh;dh=" + encoded["crypto_key"].decode('utf8')) + crypto_key += ("dh=" + encoded["crypto_key"].decode('utf8')) headers.update({ 'crypto-key': crypto_key, 'content-encoding': content_encoding, - 'encryption': "keyid=p256dh;salt=" + - encoded['salt'].decode('utf8'), + 'encryption': "salt=" + encoded['salt'].decode('utf8'), }) if gcm_key: endpoint = 'https://android.googleapis.com/gcm/send' diff --git a/pywebpush/tests/test_webpush.py b/pywebpush/tests/test_webpush.py index 71b54e7..5bc7d84 100644 --- a/pywebpush/tests/test_webpush.py +++ b/pywebpush/tests/test_webpush.py @@ -265,7 +265,7 @@ class WebpushTestCase(unittest.TestCase): "-H \"crypto-key: p256ecdsa=", "-H \"content-encoding: aesgcm\"", "-H \"authorization: WebPush ", - "-H \"encryption: keyid=p256dh;salt=", + "-H \"encryption: salt=", "-H \"ttl: 0\"", "-H \"content-length:" ]: diff --git a/requirements.txt b/requirements.txt index e770f36..93b2626 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ cryptography==1.8.1 http-ece==1.0.1 requests==2.13.0 -py-vapid==1.2.1 +py-vapid==1.2.2 diff --git a/setup.py b/setup.py index 66d8dd6..6b4e450 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os from setuptools import find_packages, setup -__version__ = "1.0.0" +__version__ = "1.0.1" def read_from(file):