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

ControllerResolver.php: return HTTP status 404 if action is not found #10623

Closed
wants to merge 1 commit into from

Conversation

gogowitsch
Copy link

Hopefully fixes #10553 and tells Google to drop error pages from its index.

Feel free to close instead of merge this if it is too crude. I'd love to know if this triggers any failed automated tests.

Background: A previously-valid URL now shows this output on our server:
image.

Google keeps on hitting this page with its Googlebot; PHP writes an entry to the error_log, which our Icinga 2 instance sees.

Hopefully fixes matomo-org#10553 and tells Google to drop error pages from its index.
@mattab
Copy link
Member

mattab commented Oct 1, 2016

Thanks for PR. It's a good idea to issue 404 to prevent google from indexing the page in the future. I think it would work 👍

Regarding implementation: we wouldn't be able to send the 404 header from within the class. we likely need to create a new exception eg. ActionNotFoundException, throw it in the getController and then catch it in the FrontController.dispatch and then output the 404 header.

@mattab mattab added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Oct 3, 2016
@mattab mattab added this to the 3.0.0-b2 milestone Oct 3, 2016
@mattab
Copy link
Member

mattab commented Oct 30, 2016

Hi @fonata do you think you could apply PR review feedback?

@mattab mattab modified the milestones: 3.0.0-b2, 3.0.0-b3 Oct 30, 2016
@mattab mattab modified the milestones: 3.0.0-b4, 3.0.0-b3, 3.0.0 Nov 14, 2016
@gogowitsch
Copy link
Author

I have great respect for your work. Sorry, I won't be able to help as I lack the time to introduce myself to the source and the tests framework.

@mattab
Copy link
Member

mattab commented Dec 18, 2016

That's alright @fonata 👍 we'll take a look in coming months (or maybe someone else reading this would be interested to pick this up!)

@mattab
Copy link
Member

mattab commented Apr 26, 2017

Thank you for this proposed pull request.

Because it was last updated more than one month ago, it is our policy to close pull requests opened for a long time without updates. If you would like to continue work on the pull request, please simply ping us to have it re-opened (after you have pushed a new commit).

We hope you understand this and we look forward to seeing an update from you on this pull request or another one!

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP error_log contains "Action 'lostPassword' not found"
2 participants