-1

The Question:

Client asks for:

Range:bytes=0-

Server responds with:

Content-Length:8396748
Content-Range:bytes 0-8396747/8396748

I want to limit that Content-Range to 1MB chunks so the server would respond like this:

Content-Length:1000000
Content-Range:bytes 0-999999/8396748

How can I make Apache/2.2.22 do this?

Regarding "What are you trying to accomplish?":

It is desirable if for (one of many) examples a user returns to an HTML5 video with auto play, pauses the video and is only interested in responding to a comment on the same page. In this example it would be unnecessarily costly to transfer the whole 128GB (current YouTube max) when the user only consumes a few MB.

Regarding "Is that valid rfc7233?":

  • One of the 4 Authors of rfc7233 said it's valid and that

    the protocol anticipates that the server might not send the same range[s] as requested

  • It works in Firefox and Chrome.
  • Not supporting it would break resuming an interrupted download.
11
  • If you check the "mitigation" section of CVE-2011-somethingorother (xrange dos) there's some instructions for messing with your range headers using apache env variables or something? Try reading httpd.apache.org/security/CVE-2011-3192.txt May 6, 2015 at 21:41
  • @some that's number of ranges not range size and regex can't help as it was not designed to count. May 7, 2015 at 0:39
  • 2
    What are you trying to accomplish? There's no obvious good reason to do this at all. May 7, 2015 at 1:03
  • @user1133275 Why are you trying to request the entire entity bytes then ? How is it better than a standard request in your case since the entire content is requested and available ? May 7, 2015 at 12:40
  • You need to read RFC 7233 very carefully. The client request shown here does not permit the server to "select the chunk size it prefers"; it actually requests the entire resource. May 7, 2015 at 13:39

1 Answer 1

0

Apache has not implemented this feature yet.

I write my own implementation in php., works nicely and is only about 20 lines.

One could use any language though (module/php/perl/python/etc).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .