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

Create shallow copy of the route context config #2827

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

mcollina
Copy link
Member

@mcollina mcollina commented Jan 31, 2021

If exposeHeadRoutes is set to true (introduced in #2700), the route config property will be wrongly altered. This PR fixes it.
I've discovered this when working on #2826.

Checklist

@mcollina mcollina requested review from Eomm and L2jLiga January 31, 2021 16:24
@mcollina
Copy link
Member Author

cc @metcoder95


fastify.get('/get', {
schema: schema.schema,
config: Object.assign({}, schema.config)
Copy link
Member

Choose a reason for hiding this comment

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

Why are you manually copying configs here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure. I copy/pasted the previous test. I guess it's not needed anymore.

@metcoder95
Copy link
Member

Oh, wow. So sorry, I didn't test the configuration context and reference when implementing. I missed that collateral detail 🙏

Copy link
Member

@L2jLiga L2jLiga left a comment

Choose a reason for hiding this comment

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

LGTM

@mcollina mcollina merged commit 1b57a57 into master Feb 1, 2021
@mcollina mcollina deleted the fix-expose-head-routes-with-context branch February 1, 2021 09:27
@github-actions
Copy link

github-actions bot commented Feb 4, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants