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: use request.routeOptions instead of deprecated request.routerPath #60

Merged
merged 1 commit into from
Nov 3, 2023
Merged

fix: use request.routeOptions instead of deprecated request.routerPath #60

merged 1 commit into from
Nov 3, 2023

Conversation

10xLaCroixDrinker
Copy link
Contributor

request.routerPath was deprecated in fastify@4.23.0. Since then it produces the following warning:

[FSTDEP017] FastifyDeprecation: You are accessing the deprecated "request.routerPath" property. Use "request.routeOptions.url" instead. Property "req.routerPath" will be removed in `fastify@5`

request.routeOptions was added in fastify@4.10.0. This approach supports backward compatibility while also avoiding accessing request.routerPath in case of a 404 in versions prior to 4.10.0.

Prior to this change, the test suite emitted this warning 11 times. It is now emitted once, only for the new test which covers the case in which request.routeOptions does not exist.

See also open-telemetry/opentelemetry-js-contrib#1757

Copy link
Collaborator

@HW13 HW13 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution @10xLaCroixDrinker!

@HW13
Copy link
Collaborator

HW13 commented Nov 3, 2023

Looks like type tests are failing, but that's not related to these changes

@HW13 HW13 merged commit cfd81c2 into autotelic:main Nov 3, 2023
0 of 3 checks passed
@10xLaCroixDrinker 10xLaCroixDrinker deleted the bugfix/routeOptions branch December 5, 2023 22: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.

2 participants