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

Reset HTTP request body after reading the stream during webhook validation #64

Merged
merged 1 commit into from
May 24, 2024

Conversation

shonun1
Copy link
Contributor

@shonun1 shonun1 commented May 24, 2024

Hi!

I couldn't find any contribution guidelines in the repository, so I've done my best to follow the existing conventions. If there are any issues with this contribution, please let me know.

To give a bit of context on the change: I started using the ValidateWebhookRequest function in the API I was developing. However, I encountered an issue where the HTTP request body was left empty after validation and I needed it for further processing. While I implemented a workaround on my end, I believe the proper solution is to reset the buffer inside the validation function to avoid interfering with any of the input data. More people might encounter this issue when the library is more widely used, so I thought I would attempt to make this change directly in the library. I look forward to your feedback!

@mattt
Copy link
Member

mattt commented May 24, 2024

Thanks so much for your contribution, @shonun1. I think you're spot on with this change. Once CI passes, I'll merge this in and cut a new release.

@mattt mattt merged commit 836ab00 into replicate:main May 24, 2024
1 check passed
@mattt
Copy link
Member

mattt commented May 24, 2024

This is now available in v0.18.2. Thanks again for your help, @shonun1 🙌

@shonun1
Copy link
Contributor Author

shonun1 commented May 24, 2024

Thank you for the quick response and release!

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

Successfully merging this pull request may close these issues.

2 participants