Skip to content

Improved: error page#4465

Merged
Alkarex merged 17 commits intoFreshRSS:edgefrom
math-GH:improve-error-page
Aug 21, 2022
Merged

Improved: error page#4465
Alkarex merged 17 commits intoFreshRSS:edgefrom
math-GH:improve-error-page

Conversation

@math-GH
Copy link
Copy Markdown
Contributor

@math-GH math-GH commented Jul 27, 2022

Before:
grafik

After:
grafik

Changes proposed in this pull request:

  • the error message is now a real HTML document (add: <!DOCTYPE><html><header><title><body>.... </body></html>
  • error message is now a HTTP 500 error
  • error message has now a CSP header
  • copied the technical information to our documentation, cut out the text from the error message and added a link to the documentation
  • the log file name is now defined as constant

How to test the feature manually:

  1. go to the logs page
  2. manipulate the page attribute (f.e. page=abc)
  3. check the error message
  4. see the 500 error in the browser's development tool

Pull request checklist:

  • clear commit messages
  • code manually tested

@math-GH math-GH added this to the 1.20.0 milestone Jul 27, 2022
math-GH and others added 2 commits July 27, 2022 20:32
Co-authored-by: Alexandre Alapetite <[email protected]>
Co-authored-by: Alexandre Alapetite <[email protected]>
lib/lib_rss.php Outdated
$details = "<pre>{$details}</pre>";
}

header('HTTP 1.1 500 Internal Server Error', true, 500);
Copy link
Copy Markdown
Member

@Alkarex Alkarex Jul 28, 2022

Choose a reason for hiding this comment

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

The function errorMessageInfo() returns some text so it should avoid emitting headers (side effect). I suggest to move this line in the killApp() function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

see my comment above

Copy link
Copy Markdown
Member

@Alkarex Alkarex Jul 31, 2022

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Could you please support here with a change/push?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Something like that 53ee1d1 (not tested)

}

header('HTTP 1.1 500 Internal Server Error', true, 500);
header("Content-Security-Policy: default-src 'self'");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similar to comment just above, except that I am not sure of where to best put that line, so maybe just leave it there for now

@Alkarex Alkarex merged commit 4214954 into FreshRSS:edge Aug 21, 2022
@math-GH math-GH deleted the improve-error-page branch March 3, 2023 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants