Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Content Type case sensitivity #134

Merged
merged 6 commits into from
Nov 15, 2023
Merged

fix: Content Type case sensitivity #134

merged 6 commits into from
Nov 15, 2023

Conversation

alexholtz
Copy link
Contributor

@alexholtz alexholtz commented Nov 15, 2023

📝 Description

  • Update schema to support content-type or Content-Type in the headers
  • Update request parsing support content-type or Content-Type header keys

This change is necessary because GitHub very recently updated their webhook payloads and they've switched from 'content-type' to 'Content-Type'.

@alexholtz alexholtz changed the title Content type case fix: Content Type case sensitivity Nov 15, 2023
@alexholtz alexholtz requested a review from danadajian November 15, 2023 23:09
...baseEvent,
headers: {
...baseEvent.headers,
'content-type': undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably remove the content-type key/value from the test since it wouldn't appear in a real headers object

Copy link
Contributor Author

@alexholtz alexholtz Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally was explicitly calling delete headers['content-type']; to remove this key/value but some investigation suggested this as a way of doing the same thing.

in TypeScript, setting a key to undefined using object spread syntax does effectively remove the key from the resulting object.

Accurate?

@alexholtz alexholtz merged commit de56887 into main Nov 15, 2023
4 checks passed
@alexholtz alexholtz deleted the content-type-case branch November 15, 2023 23:40
@danadajian
Copy link
Contributor

🎉 This PR is included in version 2.0.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants