HTTP/4xx (Client Error)
451 Unavailable For Legal Reasons
The resource cannot be served due to legal demands such as government censorship or court orders.
❓ Why does this happen?
Geo-blocking, DMCA takedowns, or sanctions compliance prevent access from the client's region.
✅ How to fix it
Nothing to fix technically; the operator must lift the legal restriction. Include a Link header pointing to the blocking authority.
Return or handle 451 in your stack
// app/api/resource/route.ts
export function GET() {
return Response.json(
{ error: "Unavailable For Legal Reasons", status: 451 },
{
status: 451
}
);
}Live 451 mock endpoint
Point your app, tests, or retry logic at this free public URL to reproduce a real 451 response (CORS enabled, optional ?delay=ms up to 5000).
https://castov.com/api/mock/451Frequently Asked Questions
What does HTTP Status 451 mean?
Why am I getting a 451 status code?
How do I fix a 451 Unavailable For Legal Reasons error?
How can I test how my app handles a 451 response?
Other 4xx status codes
Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.