Mandragor
Mar 21, 2018Altostratus
Set HTTP Reponse status code to 451
By using an example in https://devcentral.f5.com/questions/changing-http-reponse-status-code I have tried to rewrite content from a Virtual Server that initially responds with a 200 to 451 instead;
when HTTP_RESPONSE {
HTTP::collect [HTTP::header Content-Length]
}
when HTTP_RESPONSE_DATA {
HTTP::respond 451 -version 1.1 content [HTTP::payload] noserver
}
This fails in a browser, which will give a ERR_INVALID_RESPONSE error. The actual headers in the respons is:
HTTP/1.1 451 Unknown Code
Connection: Keep-Alive
Content-Length: 1444
Followed by the actual content. I suspect the issue here is that 451 is reported an unknown code, but should be standard according to RFC 7725?