Skip to content

Conversation

@bgentry
Copy link
Contributor

@bgentry bgentry commented Mar 15, 2025

Capture the request payload and reset the http request body so that ExtractRaw can still read the original payload if desired. This is useful in situations like validating a request payload against a signature.

To make this work without adding another test endpoint, I switched the GET and POST endpoints so the former is the one that implements ExtractRaw where we can test both a path param and the request body at the same time. I didn't want to have a situation where all of the endpoints implement ExtractRaw and we weren't testing the default path.

@bgentry bgentry requested a review from brandur March 15, 2025 18:54
Copy link
Contributor

@brandur brandur left a comment

Choose a reason for hiding this comment

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

Looks like some linter issues with tag alignment, but looks good.

Capture the request payload and reset the http request body so that
`ExtractRaw` can still read the original payload if desired. This is
useful in situations like validating a request payload against a
signature.
@bgentry bgentry force-pushed the bg-make-req-payload-available-to-extractraw branch from ed7f024 to 422cfb5 Compare March 16, 2025 00:17
@bgentry bgentry merged commit 76cddfc into master Mar 16, 2025
2 checks passed
@bgentry bgentry deleted the bg-make-req-payload-available-to-extractraw branch March 16, 2025 00:18
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.

3 participants