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: Avoid log spam on 404 routes not using GET #37026

Merged
merged 1 commit into from
Mar 7, 2023
Merged

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Mar 3, 2023

Summary

Avoid error logging in cases where a 404 page is rendered on non-GET requests. Ideally we would have the /error/404 route handle all http methods but this would mean we need to add each individually to the routes file as there is no combined way in the symphony router symfony/symfony#45218

[core] Fatal: Symfony\Component\Routing\Exception\MethodNotAllowedException:  at <<closure>>

0. /var/www/cloud.nextcloud.com/nextcloud/lib/private/Route/Router.php line 278
   Symfony\Component\Routing\Matcher\UrlMatcher->match("/error/404")
1. /var/www/cloud.nextcloud.com/nextcloud/lib/private/Route/Router.php line 307
   OC\Route\Router->findMatchingRoute("/error/404")
2. /var/www/cloud.nextcloud.com/nextcloud/lib/base.php line 1098
   OC\Route\Router->match("/error/404")
3. /var/www/cloud.nextcloud.com/nextcloud/index.php line 36
   OC::handleRequest()

PUT /testing-put.txt

Checklist

Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliusknorr juliusknorr requested review from come-nc, nickvergessen, a team, ArtificialOwl and icewind1991 and removed request for a team March 3, 2023 08:42
@juliusknorr juliusknorr added bug 3. to review Waiting for reviews labels Mar 3, 2023
@juliusknorr juliusknorr added this to the Nextcloud 27 milestone Mar 3, 2023
@juliusknorr
Copy link
Member Author

/backport to stable26

Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

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

I had this fixed locally as well already. seems I just didn't send it yet :-X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants