Test a server for byte range support?

Podcasting with iTunes requires byte-range request support. I'm assisting someone who is having trouble getting their podcast accepted by Apple for inclusion in their iTunes store, and it was suggested that their web server is not currently supporting byte-range requests.

My question is: Is there a way I can test whether or not the web server is handling byte-range requests correctly? I don't have any access to the web server other than the normal public requests. If I have the URL to an MP3 file on the web server, can I use a web browser or other tool to test this, perhaps looking at HTTP headers?


Solution 1:

This command assumes Linux - but would probably work on windows or mac with minor alteration - curl is widely available, but may not be installed on your system of choice by default. The example file I am getting is the curl manual - a handy URL ;)

curl --silent --range 20-40 https://curl.haxx.se/docs/manpage.html | wc -c

This returns "21" - I have asked for bytes 20-40, and then curl outputs to stdout, which I pipe to wc to count the characters.

If you get an answer that's much bigger, the server has sent the whole file (try "www.youtube.com" - that serves the entire index regardless of what range you ask).

So you're looking for the magic 21 here to say "byte range isn't the problem".

Mac alternatives (even though curl on the Mac seems to work for me... I may have installed a special version):

brew install wget
wget --header="Range: bytes=20-40" -t 1 http://www.youtube.com

If this fails with a 206, it means it got a range. You could probably send the header "manually" with curl, too.