8

How can i enable byte range request? While pod casting on itunes it gives an error message "There is a problem with your feed. Your episodes are hosted on a server which doesn’t support byte-range requests. Enable byte-range requests and try your submission again.".
Please give me a method to enable byte range request

praji
  • 181
  • 1
  • 1
  • 2

2 Answers2

6

Apache handles it out of the box for static content. If the content is being generated by PHP then you'll need to amend your PHP code accordingly.

Supposedly the http_send_file() and http_send_data() functions handle range requests - but I'm not sure what that means in practice - some experimentation required.

symcbean
  • 19,931
  • 1
  • 29
  • 49
5

Apache supports the Byte-Range request out of the box - assuming it's not been explicitly disabled to get around this DoS bug (http://httpd.apache.org/security/CVE-2011-3192).

You can test with something trivial like the following (in PHP) :

<?php
$range = '60-120';
$host = "my.domain.name";
$socket = fsockopen($host,80);
$packet = "GET /path/to/static/file.xml HTTP/1.1\r\nHost: $host\r\nRange:bytes=$range\r\nAccept-Encoding: gzip\r\nConnection: close\r\n\r\n";
fwrite($socket,$packet);
echo fread($socket,2048);

Running the above, should result in something like the following :

HTTP/1.1 206 Partial Content
Date: Tue, 10 Jul 2012 11:17:55 GMT
Server: Apache
Last-Modified: Tue, 10 Jul 2012 10:12:23 GMT
Accept-Ranges: bytes
Content-Length: 61
Content-Range: bytes 60-120/6433
Connection: close
Content-Type: text/xml

tp://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<ch

If the above doesn't work, then it's likely someone's turned off the Range header - see the above URL for suggestions of what to look for in either .htaccess files or the global Apache configuration.

David Goodwin
  • 500
  • 3
  • 10
  • 1
    Or test from the command line with e.g. `curl -i -X HEAD --header "Range: bytes=50-100" http://www.example.com/style.css` which should return "HTTP/1.1 206 Partial Content". – Avatar Apr 10 '21 at 15:00