FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Implement json error pages by davispuh · Pull Request #44 · HttpErrorPages/HttpErrorPages · GitHub

Implement json error pages - #44

Open
davispuh wants to merge 1 commit into
HttpErrorPages:masterfrom
davispuh:json
Open

Implement json error pages#44
davispuh wants to merge 1 commit into
HttpErrorPages:masterfrom
davispuh:json

Conversation

davispuh commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

Implement json error pages.
This is useful when JSON backend/API doesn't have nice error info and might return blank page.

To use with Nginx:

map $http_accept $errorExtension
{
    default                    html;
    ~application/json          json;
    ~application/activity+json json;
}


error_page 400 /ErrorPages/HTTP400.$errorExtension;
error_page 401 /ErrorPages/HTTP401.$errorExtension;
error_page 403 /ErrorPages/HTTP403.$errorExtension;
# ...

This will cause that when client has Accept: application/json header then it will get JSON response.

Copy link
Copy Markdown
Contributor Author

Ping? Could you merge my PRs?

Copy link
Copy Markdown
Contributor Author

What about this one?

Copy link
Copy Markdown
Member

tldr: technically out of scope

Copy link
Copy Markdown
Contributor Author

How so? I need a solution to handle all error pages even for JSON APIs and this looks like best tool. It doesn't make sense to have separate tool just for JSON when this could do it all.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL