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: handle invalid url #3128

Merged
merged 3 commits into from Jun 10, 2021
Merged

fix: handle invalid url #3128

merged 3 commits into from Jun 10, 2021

Conversation

climba03003
Copy link
Member

Fixes: #3127

Checklist

@Eomm Eomm added the bugfix Issue or PR that should land as semver patch label Jun 10, 2021
Copy link
Member

@mcollina mcollina 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 added this to the v4.0.0 milestone Jun 10, 2021
@mcollina mcollina added the semver-major Issue or PR that should land as semver major label Jun 10, 2021
test/404s.test.js Outdated Show resolved Hide resolved
lib/fourOhFour.js Outdated Show resolved Hide resolved
const body = `{"error":"Not Found","message":"${message}","statusCode":404}`

// simulate normal route logging
const id = genReqId(req)
Copy link
Member Author

Choose a reason for hiding this comment

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

I would like to have some feedback about the logging. Do we have a better approach for this one?

Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link
Member

@mcollina mcollina 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 4fb2e09 into fastify:next Jun 10, 2021
mcollina pushed a commit that referenced this pull request Apr 1, 2022
* fix: handle invalid url (#3128)

* fix: handle invalid url

* refactor: handle as 404 instead of 400

* fix: respect disableRequestLogging

* chore: linting

* feat: allow to customize 404 onBadUrl handler
@github-actions
Copy link

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 Jun 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix Issue or PR that should land as semver patch semver-major Issue or PR that should land as semver major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants