Search code examples
web-serviceshttpamazon-web-servicesamazon-cloudfront

Is it valid to respond to an HTTP 1.1 request with an HTTP 1.0 response?


I am setting up video delivery for video files to tv set-top boxes. I want to use Amazon Cloudfront. The video files are requested as usual http requets that may contain a range header to request partial resources (to enable the user on the box to jump into any position within the video).

My problem is that it is working on 2 of 3 boxes, one makes problems.

The request looks like this (sample data):

GET /path/file.mp4 HTTP/1.1
User-Agent: My User Agent
Host:myhost.com
Accept:*/*
Range: bytes=100-200

So if I do a request to cloudfront using telnet I see that the response is HTTP 1.0:

joe@flimmit-joe:~$ telnet d2zf9fl0izzsf6.cloudfront.net 80
Trying 216.137.61.164...
Connected to d2zf9fl0izzsf6.cloudfront.net.
Escape character is '^]'.
GET /skin/frontend/default/flimmit/images/headerbanners/02_green.png HTTP/1.1
User-Agent: My User Agent
Host:d2zf9fl0izzsf6.cloudfront.net
Accept:*/*
Range: bytes=100-200

HTTP/1.0 206 Partial Content
Date: Sun, 12 Feb 2012 18:42:15 GMT
Server: Apache/2.2.16 (Ubuntu)
Last-Modified: Tue, 26 Jul 2011 10:37:54 GMT
ETag: "1e0b8a-2d2b-4a8f6863ac11a"
Accept-Ranges: bytes
Cache-Control: max-age=2592000
Expires: Tue, 13 Mar 2012 18:42:15 GMT
Content-Type: image/png
Age: 351213
Content-Range: bytes 100-200/11563
Content-Length: 101
X-Cache: Hit from cloudfront
X-Amz-Cf-Id: W2fzPeBSWb8_Ha_UzvIepZH-Z9xibXyRddoHslJZ3TDXyFfjwE3UMQ==,CwiKc8-JGfE77KBVTTOyE9g-OYf7P-bCJZEWGwef9Es5rzhUBYKE8A==
Via: 1.0 972e3ba2f91fd0a38ea062d0cc03be37.cloudfront.net (CloudFront)
Connection: close

q�]#��ĥM�oӘ�i��i��������Y�.��/��ib���&
���
�Ⱦ�00�>�����Y`��X���r���s�=�n�s�b���7MConnection closed by foreign host.
joe@flimmit-joe:~$ 

Unfortunately I have only limited access to the box for testing purposes. However this behavior by cloud-front seems strange to me so I wanted to ask whether it is even valid.


Solution

  • It is absolutely "valid" to answer with Http 1.0 to an Http 1.1 request.

    I'll cite the Appendix 19.6 to the RFC2068 "It is beyond the scope of a protocol specification to mandate compliance with previous versions. HTTP/1.1 was deliberately designed, however, to make supporting previous versions easy."

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.6

    The important part is basically that the RFC does not force an Http 1.1 answer, so it's up to the server.