Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #302
Specify utf-8 body encoding on webhook requests. The emojis in campsites json body cannot be encoded with latin-1 encoding and
camply
crashes. The utf-8 encoding is the json spec character encoding, so it seems like an OK default stance forcamply
to take.Before
WEBHOOK_URL="http://localhost:8000" camply campsites --campground 233998 --start-date 2023-10-10 --end-date 2023-10-21 --notifications webhook
..would crash with
Has This Been Tested?
In background shell, start a simple webhook handler
then run:
(camply) (base) zach@z-pc:~/src/camply$ hatch shell
..and the webhook handler prints:
..also,
Checklist:
.pre_commit
on all my code(also, this is the first GitHub PR I've ever made, so apologies if something's not quite right).