HTTP status code 305 indicates that the requested resource must be accessed through a specified proxy server. When the server returns a 305 status code, it provides the URI of the proxy server in the Location
response header, and the client needs to resend the request through this proxy server to access the resource.
Common Use Cases for 305 Status Code
-
Access Control: When the server wants to control access to resources through a proxy server.
-
Traffic Management: The server may want to manage access to resources via a proxy for traffic management or load balancing.
-
Security Policies: The server may need to implement certain security policies through a proxy server.
Important Considerations
The 305 status code can only be generated by the original server and should not be cached, as this could lead to security issues. Additionally, RFC 2068 does not explicitly state that a 305 response is intended to redirect a single request, and it can only be established by the original server. Ignoring these restrictions may lead to serious security consequences.
In practice, due to the configuration of HTTP proxies and security concerns, the use of the 305 status code is not common. Most modern browsers and clients may not encounter this status code or may not handle it correctly. Therefore, caution is advised when using the 305 status code.