-
Notifications
You must be signed in to change notification settings - Fork 107
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
Change not found behaviour to just redirect to index #13
base: master
Are you sure you want to change the base?
Conversation
@TilCreator please check if requests for e.g. |
It gets ignored, but it executes the scan again, so I changed it to redirect every url containing |
if 'favicon' in url: | ||
send_header(client, status_code=404) | ||
else: | ||
send_header(client, status_code=307, redirect='/') |
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.
can you explain why this is an improvement?
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.
I see now, that this would only be necessary if a custom DNS was in use, but like this it is only a very minor improvement of 404 handling and even that is debatable.
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.
not sure what you mean.
but in general, a simple and direct error handling is preferable (just say there is a problem and what the problem is). if one introduces some magic instead of that, it often makes finding problems more complicated, hides problems.
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.
Proceed as you wish.
This removes the 404 page and replaces it with a redirect with the
Location
HTTP header.