-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
When visit /favicon.ico and the static file is not exist return 404 but not continue to handle the route #14211
When visit /favicon.ico and the static file is not exist return 404 but not continue to handle the route #14211
Conversation
…ut not continue to handle the route
Codecov Report
@@ Coverage Diff @@
## master #14211 +/- ##
=======================================
Coverage 42.01% 42.01%
=======================================
Files 734 734
Lines 78773 78773
=======================================
+ Hits 33093 33096 +3
+ Misses 40244 40242 -2
+ Partials 5436 5435 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does indeed fix the problem. Thank you!
Applied the patch to gitea 1.13.1 and set REQUIRE_SIGNIN_VIEW = true
:
- before patch:
# curl -sI 127.0.0.1:3000/favicon.ico | grep -E "HTTP|redirect|Location"
HTTP/1.1 302 Found
Location: /user/login
Set-Cookie: redirect_to=%2Ffavicon.ico; Path=/
- after:
# curl -sI 127.0.0.1:3000/favicon.ico | grep -E "HTTP|redirect|Location"
HTTP/1.1 404 Not Found
Note, however, that the issue can still happen if the browser requests some other arbitrary file not listed in KnownPublicEntries
(though that's unlikely; can't remember anything right now).
@lunny please send backport :) |
…ut not continue to handle the route (go-gitea#14211) Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This should fix #13771. When requesting a route
/favicon.ico
and there is no static file found, a 404 should be given immediately but not continue next middlewares or routes.@nuno-silva could you confirm this fix your problem?