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(node/nestjs): Use method on current fastify request #15066

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

tjhiggins
Copy link
Contributor

The previous code was using fastify request.routeOptions.method which is all methods the current route supports - not the current request method.
Ex. @All() nestjs decorator request.routeOptions.method = ['GET', 'POST', 'HEAD', ...]

  • Added a test for @All()
  • Updated instances of fastify request to use request.method which matches express

@tjhiggins tjhiggins changed the title bug(fastify): Use the method on the current request - not all methods supported by the endpoint fix(fastify): Use the method on the current request - not all methods supported by the endpoint Jan 19, 2025
@mydea mydea requested a review from chargome January 20, 2025 10:52
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

Hey @tjhiggins, thanks for the fix and the added test! The changes make sense to me, could you just format the files so our CI is happy?

@tjhiggins
Copy link
Contributor Author

@chargome should be good now

@mydea
Copy link
Member

mydea commented Jan 20, 2025

@chargome we should also backport this to v8 I guess!

@chargome chargome changed the title fix(fastify): Use the method on the current request - not all methods supported by the endpoint fix(node/nestjs): Use method on current fastify request Jan 21, 2025
@chargome chargome merged commit 6bf2374 into getsentry:develop Jan 21, 2025
115 checks passed
chargome added a commit that referenced this pull request Jan 21, 2025
The previous code was using fastify `request.routeOptions.method` which
is all methods the current route supports - not the current request
method.
Ex. `@All()` nestjs decorator `request.routeOptions.method = ['GET',
'POST', 'HEAD', ...]`

- Added a test for `@All()`
- Updated instances of fastify request to use `request.method` which
matches express

---------

Co-authored-by: Charly Gomez <charly.gomez@sentry.io>
mydea added a commit that referenced this pull request Jan 21, 2025
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #15066

---------

Co-authored-by: chargome <20254395+chargome@users.noreply.github.com>
Co-authored-by: Francesco Gringl-Novy <francesco.novy@sentry.io>
chargome added a commit that referenced this pull request Jan 21, 2025
Backports #15066

---------

Co-authored-by: tjhiggins <thomashiggins10@gmail.com>
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