質問

rfc2616 (HTTP/1.1):

A response to a request for a single range MUST NOT be sent using the multipart/byteranges media type.

A response to a request for multiple ranges, whose result is a single range, MAY be sent as a multipart/byteranges media type with one part.

A client that cannot decode a multipart/byteranges message MUST NOT ask for multiple byte-ranges in a single request.

If I understand this correctly, multiple ranges in a single request MAY use multipart/byteranges and clients MUST be able to decode it or shouldn't request it at all.

Does the "MAY" imply that there are also alternatives to multipart/byteranges that could be used? Do any exist? If so, are there headers to request them?

For example, could a server potentially concatenate all byte ranges into a single part response?

役に立ちましたか?

解決

If a request asks for multiple ranges and the server can concatenate the requested ranges into a single continuous range, then the response can either:

  • use multipart/byteranges with a single MIME part for the concatenated range, where the part has its own Content-Range header.

  • send the concatenated data by itself and include a top-level Content-Range header.

他のヒント

As far as my experience back in 2012, I would reommend to stick to the first, i.e. "A response to a request for a single range MUST NOT be sent using the multipart/byteranges media type." because some clients will choke.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top