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

dieWithHtmlErrorPage() should default to http 500 #17206

Merged
merged 1 commit into from Feb 9, 2021

Conversation

andyjdavis
Copy link
Contributor

@andyjdavis andyjdavis commented Feb 8, 2021

Description:

This is a possible solution for this issue. #10881
"Error page served with HTTP 200 status"

Prior to this PR dieWithHtmlErrorPage() defaults to returning a http 200 if the caught exception doesn't have a code set on it. This PR instead causes dieWithHtmlErrorPage() to default to returning a http 500 unless another code is set.

This is the URL I have been using. Note the invalid date parameter. the error page is identical however its http status code is now 500 instead of 200.
http://localhost/matomo/index.php?module=CoreHome&action=index&idSite=1&period=day&date=INVALID

I am still working through getting the tests working locally. I get a few failures even before I make any changes. Despite that I wanted to put this PR up now just to see if this approach is fundamentally a problem in some way :)

Review

  • Functional review done
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

@diosmosis diosmosis added this to the 4.2.0 milestone Feb 9, 2021
@diosmosis diosmosis merged commit f3782b9 into matomo-org:4.x-dev Feb 9, 2021
@diosmosis
Copy link
Member

Hi @andyjdavis, I merged this, thanks for the great contribution!

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.

None yet

2 participants