404 header - HTTP 1.0 or 1.1?

前端 未结 6 1634
心在旅途
心在旅途 2020-11-30 07:54

Why does almost every example I can find (including this question from about a year ago) say that a 404 header should be HTTP/1.0 404 Not Found when we\'ve real

6条回答
  •  一整个雨季
    2020-11-30 08:19

    I'd have thought that the response should be HTTP/1.0 404 Not Found if the request was a HTTP 1.0, and HTTP/1.1 404 Not Found if the request was HTTP 1.1.

    In practice, it's going to be easier for servers to returned canned responses, and the HTTP 1.0 response will be understood by both 1.0 and 1.1 clients, so safest to return that. If you know the client understands 1.1 (e.g. because that's what it asked for), then the 1.1 response should work.

    Arguably, play it safe and send the 1.0 response.

提交回复
热议问题