Support requests_session param in webpush fn too (#133)

* support requests_session param in webpush fn too
* format for line length
* move new requests_session argument to the end of the arg list
This commit is contained in:
Bruno Windels 2021-03-15 17:51:52 +00:00 committed by GitHub
parent 05f90f13fb
commit 336b1fb1ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -383,7 +383,8 @@ def webpush(subscription_info,
timeout=None,
ttl=0,
verbose=False,
headers=None):
headers=None,
requests_session=None):
"""
One call solution to endcode and send `data` to the endpoint
contained in `subscription_info` using optional VAPID auth headers.
@ -473,7 +474,9 @@ def webpush(subscription_info,
print("\t headers: {}".format(vapid_headers))
headers.update(vapid_headers)
response = WebPusher(subscription_info, verbose=verbose).send(
response = WebPusher(
subscription_info, requests_session=requests_session, verbose=verbose
).send(
data,
headers,
ttl=ttl,