Unavailable For Legal Reasons
Production Risk
Low from a technical perspective, but high from a social and political one. It indicates the presence of censorship or legal action.
The user-agent requested a resource that cannot be served for legal reasons, such as a web page censored by a government. The response should include a 'Link' header that provides a description of the legal demand.
- 1A court order requires an ISP to block access to a specific website.
- 2A government mandates the removal of content considered illegal in that jurisdiction.
- 3A hosting provider takes down content in response to a copyright claim.
A user in a specific country tries to access a news article that has been blocked by a government censorship order.
GET /censored-article HTTP/1.1 Host: news.example.com
expected output
HTTP/1.1 451 Unavailable For Legal Reasons
Fix
Return 451 with a Link header describing the legal demand
WHEN When implementing 451 as a server operator responding to a legal takedown
HTTP/1.1 451 Unavailable For Legal Reasons Link: <https://legalinfo.example.com/order-12345>; rel="blocked-by" Content-Type: text/html <html><body>This content has been removed pursuant to court order 12345.</body></html>
Why this works
RFC 7725 requires a Link header with rel='blocked-by' pointing to a resource describing the authority behind the restriction. This allows transparency about the legal demand while complying with it.
✕ Return 403 Forbidden instead of 451
403 gives no signal that the restriction is legal rather than technical. 451 is specifically meaningful for legal censorship and allows automated reporting tools to track censorship incidents.
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev