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

Change not found behaviour to just redirect to index #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TilCreator
Copy link
Contributor

This removes the 404 page and replaces it with a redirect with the Location HTTP header.

@tayfunulu tayfunulu requested a review from ThomasWaldmann May 29, 2018 11:46
@JK-de
Copy link

JK-de commented May 29, 2018

@TilCreator please check if requests for e.g. favicon.ico are handled correctly

@TilCreator
Copy link
Contributor Author

It gets ignored, but it executes the scan again, so I changed it to redirect every url containing favicon.

if 'favicon' in url:
send_header(client, status_code=404)
else:
send_header(client, status_code=307, redirect='/')
Copy link
Collaborator

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?

Copy link
Contributor Author

@TilCreator TilCreator May 30, 2018

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Proceed as you wish.

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

Successfully merging this pull request may close these issues.

3 participants