-
Notifications
You must be signed in to change notification settings - Fork 106
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
feat(gateway): add DisableHTMLErrors option #463
Conversation
Codecov Report
@@ Coverage Diff @@
## main #463 +/- ##
==========================================
- Coverage 66.41% 66.32% -0.09%
==========================================
Files 207 204 -3
Lines 24692 24621 -71
==========================================
- Hits 16398 16329 -69
+ Misses 6868 6862 -6
- Partials 1426 1430 +4
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hacdias I think this is a sensible flag to have here and in Kubo(no matter if this is used by bifrost infra or not).
HTML Error pages include IPFS brand and links to project docs, and users may want to disable that to have whitelabel hosting setup.
Just rename it, so it is more clear what it does, either:
ForcePlainTextErrors
DisableHTMLErrors
← imo preferable, does what it says, does not corner us into returning plain text error forever (we can start returning JSON instead, and this won't break or look awkward)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature is now nice and clear, thanks! ❤️
Mind bubbling up to Kubo?
This adds a new option
DisableHTMLErrors
togateway.Config
. If this istrue
, then the errors will always be returned astext/plain
with the raw error message. This will need to be bubbled up to Kubo, which will then allowipfs.io
to have a better insight into the error messages.This also allows users of
boxo/gateway
library to do white-label hosting, without IPFS branding on error pages.cc @cewood @mcamou