Bug 1735923 Comment 11 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Firefox [adds ResourceTiming entries](https://searchfox.org/mozilla-central/rev/840881e1232f664a58b39caaae6284c7bcf121df/netwerk/protocol/http/HttpBaseChannel.cpp#5094) for both 206 and 416 responses. 
In Firefox, a shorter than ServiceWorker-exagerated cross-origin resource is distinguishable due to Firefox making an additional range request when the cross-origin server returns a shorter response than expected. 

The expected length is [set](https://searchfox.org/mozilla-central/rev/840881e1232f664a58b39caaae6284c7bcf121df/dom/media/MediaCache.cpp#1942) based on the range total [from the initial response](https://searchfox.org/mozilla-central/rev/1c54648c082efdeb08cf6a5e3a8187e83f7549b9/dom/media/ChannelMediaResource.cpp#227) (from the ServiceWorker in this case).
The expected length can be [increased when a longer response is received](https://searchfox.org/mozilla-central/rev/840881e1232f664a58b39caaae6284c7bcf121df/dom/media/MediaCache.cpp#2042), but the [final assessment that could have used the total bytes received to correctly shorten the expected length](https://searchfox.org/mozilla-central/rev/840881e1232f664a58b39caaae6284c7bcf121df/dom/media/MediaCache.cpp#2126) is not reached before the additional request is sent due to a [comparison based on the incorrect length](https://searchfox.org/mozilla-central/rev/840881e1232f664a58b39caaae6284c7bcf121df/dom/media/ChannelMediaResource.cpp#371).
Firefox [adds ResourceTiming entries](https://searchfox.org/mozilla-central/rev/840881e1232f664a58b39caaae6284c7bcf121df/netwerk/protocol/http/HttpBaseChannel.cpp#5094) for both 206 and 416 responses. 
In Firefox, a shorter than ServiceWorker-exagerated cross-origin resource is distinguishable due to Firefox making an additional range request when the cross-origin server returns a shorter response than expected. 

The expected length is [set](https://searchfox.org/mozilla-central/rev/840881e1232f664a58b39caaae6284c7bcf121df/dom/media/MediaCache.cpp#1942) based on the range total [from the initial response](https://searchfox.org/mozilla-central/rev/1c54648c082efdeb08cf6a5e3a8187e83f7549b9/dom/media/ChannelMediaResource.cpp#227,241,244) (from the ServiceWorker in this case).
The expected length can be [increased when a longer response is received](https://searchfox.org/mozilla-central/rev/840881e1232f664a58b39caaae6284c7bcf121df/dom/media/MediaCache.cpp#2042), but the [final assessment that could have used the total bytes received to correctly shorten the expected length](https://searchfox.org/mozilla-central/rev/840881e1232f664a58b39caaae6284c7bcf121df/dom/media/MediaCache.cpp#2126) is not reached before the additional request is sent due to a [comparison based on the incorrect length](https://searchfox.org/mozilla-central/rev/840881e1232f664a58b39caaae6284c7bcf121df/dom/media/ChannelMediaResource.cpp#371).

Back to Bug 1735923 Comment 11