ipfs / ipfs/boxo

gateway: dedicated error type for denylists

Open
#591 2 comments 1 reaction 0 assignees View on GitHub
dif/medium kind/enhancement P2 topic/gateway
Dominant language
Go
Stars
316
Forks
163
Avg merge
4d 12h
Merged PRs (30d)
8

Description

Right now we don't use proper error types to convey that some content requested by a gateway was blocked. Instead we have this string based checking tied to nopfs

https://github.com/ipfs/boxo/blob/b101ba0858150cd6a34b6cb68eefd28c411bd58c/gateway/errors.go#L211-L216

@MichaelMure recently let me know that:
1. Infura also does some string based error checking for their errors
2. They return 451 when rather than just 410

So it seems to me like this should be bundled into boxo tooling.
1. Have an error type indicating that it's a blocked error (which other tools like nopfs or others can wrap)
2. Given that 451 and 410 both seem plausible either that should be configurable by the error tooling, or at the gateway level
- At the moment I don't know anyone mixing 410s + 451s but that may not always be the case

@MichaelMure let me know if there's any context I missed.

cc @lidel

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.