Christian Riedl
Christian Riedl

Reputation: 103

HTTP HEAD request with Range Header

I am working on a DLNA Server using IIS as Server for media. Some DLNA Client sends a http HEAD request with a range Header :

Command: HEAD

+ URI: /RicDLNA/Streamer.ashx?media=/Videos/Guca%20Distant%20Trumpet/Gucha%20Distant%20Trumpet.mp4 ProtocolVersion: HTTP/1.1 Host: 192.168.1.100 range: bytes=0- transferMode.dlna.org: Streaming HeaderEnd: CRLF

I respond only with "Accept-Ranges Bytes". But IIS delivers a statuscode 416 error. It looks that this error Status prevents the client to continue.

  1. Is it allowed to send such a range Header in a HEAD request ?
  2. What shall i response that the client knows that ranges are supported and invoiding the IIS generated statuscode 416.
  3. Is there a possibility to override bad IIS statuscode with an OK status ?

Upvotes: 1

Views: 3420

Answers (2)

bart s
bart s

Reputation: 5110

In ietf.org RFC7233 section 3.1 Range you can find the excerpt

A server MUST ignore a Range header field received with a request method other than GET

To me this means as much as : you can make a range-request with a HEAD command, but your server must ignore it.

Upvotes: 3

Tal Aloni
Tal Aloni

Reputation: 1519

IIS 6.0 and IIS 7.0 will accept HEAD requests containing Range header (and will return status 206 expected by some media players such as the Popcorn Hour A-100).

I recently needed to make IIS 7.5 treat those requests the same as IIS 6.0 / 7.0, and was able to do so using the Beta http.sys v6.1.7000.0 and pre-Beta static.dll v6.1.6801.0 (driver signature enforcement must be circumvented on 64-bit versions of Windows)

Upvotes: 0

Related Questions