HTTP Redirection Hell

Jun 2, 2008

I've been listening to the Zippcast podcast for a while, it's quite interesting for a bike tech nerd like me, even though it's a marketing oriented podcast. The problem is that the podcast doesn't work in iTunes. Lets look at the latest episode:

Examining the feed at http://feeds.feedburner.com/zipp I obtain the URL for the MP3 file (The /rss/channel/item/enclosure element, expressed in XPath): http://feeds.feedburner.com/~r/zipp/~5/294555004/080519_ZippCast_0049.mp3.

Lets examine the headers:

% curl --head http://feeds.feedburner.com/~r/zipp/~5/294555004/080519_ZippCast_0049.mp3
HTTP/1.0 302 Moved Temporarily
Date: Mon, 02 Jun 2008 20:28:29 GMT
Server: Apache
X-FB-Host: app15
Location: http://cdn4.libsyn.com/zipp/080519_ZippCast_0049.mp3
P3P: CP="ALL DSP COR NID CUR OUR NOR"
Keep-Alive: timeout=30, max=100
Connection: keep-alive
Content-Type: audio/mpeg

If you don't have curl(1) you can use lynx(1), links(1) or w3m(1) instead, refer to the respective manuals for how to see HTTP headers. The curl(1) prgram is standard on Mac OS X, and even works on Windows too.

The Location: HTTP header is a redirect. Lets follow:

% curl --head http://cdn4.libsyn.com/zipp/080519_ZippCast_0049.mp3
HTTP/1.1 302 Moved Temporarily
Date: Mon, 02 Jun 2008 20:29:11 GMT
Content-Length: 206
Content-Type: text/html
Location: http://media.libsyn.com/bounce/http://cdn4.libsyn.com/zipp/080519_ZippCast_0049.mp3
Server: Footprint Distributor V4.2
Connection: keep-alive

% curl --head http://media.libsyn.com/bounce/http://cdn4.libsyn.com/zipp/080519_ZippCast_0049.mp3
HTTP/1.1 301 Moved Permanently
X-Powered-By: PHP/5.1.4
Location: /media/zipp/080519_ZippCast_0049.mp3
Content-type: text/html
Date: Mon, 02 Jun 2008 20:29:46 GMT
Server: lighttpd/1.4.15

Ooops! According to rfc2616 the Location header must be an absolute URI, not relative as here. Lets see what happens if I fix it manually:

% curl --head http://media.libsyn.com/media/zipp/080519_ZippCast_0049.mp3
HTTP/1.1 302 Found
X-Powered-By: PHP/5.1.4
Location: http://cdn1.libsyn.com/zipp/080519_ZippCast_0049.mp3?nvb=20080602203748&nva=20080603203748&t=00d47876b74e289c7df18
Content-type: text/html
Date: Mon, 02 Jun 2008 20:37:48 GMT
Server: lighttpd/1.4.15

% curl --head 'http://cdn1.libsyn.com/zipp/080519_ZippCast_0049.mp3?nvb=20080602203748&nva=20080603203748&t=00d47876b74e289c7df18'
HTTP/1.1 200 OK
Content-Length: 9581864
Content-Type: audio/mpeg
ETag: "40f21e8c7f96c1a78999155117a5c32c"
Last-Modified: Mon, 19 May 2008 15:18:02 GMT
Server: AmazonS3
x-amz-request-id: 8EE745DC60620FC8
x-amz-id-2: Trs3w1sY7bwGJIUya2WesWU6SBDyCtQWGEG8PUrySXr6+0YjC/r73J0mrNImSoOY
Date: Mon, 02 Jun 2008 20:38:41 GMT
Connection: keep-alive

Finally I get the actual audio file.

Whether it's the invalid Location: header or the number of redirects to get to the file that iTunes chokes on I can't tell, but it seems to be a misconfiguration at Libsyn.

If I were to create a corporate podcasting setup I'd seriously consider not using external partners for it as Zipp does. Too many things can go wrong, as seen here, and it just looks bad. But it's probably significantly cheaper to risk looking bad, so in the end it's a question about money as always.


Last edited: May 1, 2016


Categories: