Chrome bad Range header: Range: bytes=0-

2,004 views
Skip to first unread message

Loreto Parisi

unread,
Nov 15, 2018, 4:59:33 AM11/15/18
to Chromium-dev
My express node.js server does mp4 streaming with Partial HTTP Content (206). When in Safari this works on, but not in Chrome.

My workflow it this one

Client (Chrome) :/streams/#streamID?start=12&end=34 ----> REQUEST 1 ----> Node.js/Express --(Range)---> MediaServer ---- RESPONSE 1 (Content-Range)---> Client (Chrome)  bytes

When in Chrome, the browser raises REQUEST 2 (with the wrong header "Range= bytes 0-", while Safari will not. In fact Safari works ok, while Chrome is not. So the problem is? Does Safari implement HTTP 206 differently and Chrome is more strict on that? I will not expect this.


You can see the REQUEST/RESPONSE 1 and 2 here:


There should not be the REQUEST 2 from the browser. This request comes from the Google Chrome page when you put in a streaming URL like mp3, etc. It injects into the page a built-in payer (strangely it's a <video> tag, while it should be a <audio> tag), and start that request.

Let's make an example. If you go here (this is not mine, just an example) you will see how Chrome raises a bad request (REQUEST 2) pushing an invalid "Range: bytes=0-" header in in this example:


You can see in the Console the two requests

REQUEST 1
GET /mp3/Beethoven_12_Variation.mp3 HTTP/1.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7,es;q=0.6,de;q=0.5,ru;q=0.4

RESPONSE 1
HTTP/1.1 200 OK
Date: Thu, 15 Nov 2018 09:52:54 GMT
Server: Apache
Last-Modified: Fri, 26 Mar 2004 15:55:11 GMT
ETag: "1d014e-3d68ac9e215c0"
Accept-Ranges: bytes
Content-Length: 1900878
Keep-Alive: timeout=2, max=200
Connection: Keep-Alive
Content-Type: audio/mpeg


REQUEST 2
GET /mp3/Beethoven_12_Variation.mp3 HTTP/1.1
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36
Accept: */*
Accept-Language: it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7,es;q=0.6,de;q=0.5,ru;q=0.4
Range: bytes=0-           <----------- HERE!!!! IT's CHROME BUG THEN ?!?


RESPONSE 2
HTTP/1.1 206 Partial Content
Date: Thu, 15 Nov 2018 09:52:55 GMT
Server: Apache
Last-Modified: Fri, 26 Mar 2004 15:55:11 GMT
ETag: "1d014e-3d68ac9e215c0"
Accept-Ranges: bytes
Keep-Alive: timeout=2, max=200
Connection: Keep-Alive
Content-Type: audio/mpeg
Content-Range: bytes 0-1900877/1900878
Content-Length: 1900878

PhistucK

unread,
Nov 15, 2018, 5:29:26 AM11/15/18
to loreto...@gmail.com, Chromium-dev
This is a technical browser development group, mainly for build issues and similar, not for bug discussions.
Please, use net-dev for this discussion instead. I find it weird that you respond with 206 to a non-range request in the first place (that scenario seems invalid to me), but I do not really know what the standards say about this type of thing. Anyway, continue this discussion in the other group, as it is off topic here.

PhistucK


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/5437bdb3-700f-47fd-b632-5b3769f5430e%40chromium.org.

Loreto Parisi

unread,
Nov 15, 2018, 6:02:32 AM11/15/18
to Chromium-dev, loreto...@gmail.com
okay moved the discussion here: https://groups.google.com/a/chromium.org/forum/#!topic/net-dev/hYiP5m0K7ZE
I think that this scenario is valid, in fact Safari supports it and it works ok ( my guess of course, but it works!)
Reply all
Reply to author
Forward
0 new messages