web-push-libs / pywebpush

Python Webpush Data encryption library
Mozilla Public License 2.0
314 stars 53 forks source link

Webpush headers #123

Closed braedon closed 4 years ago

braedon commented 4 years ago

Add support for adding extra headers when using the webpush() function.

It'd be nicer to add the headers kwarg in a similar position in the argument list to where it is in .send(), but added it to the bottom of the list to avoid changing argument order for those using positional arguments.

I haven't added explicit kwargs for Urgency and Topic to keep this PR small, but it'd be nice to add them to match the TTL support.

Implements https://github.com/web-push-libs/pywebpush/issues/120