Don't Use CSS Files from raw.github.com

The other day I was hunting for a bug in bootstrap, and I wanted to get an older version of their js + css up on jsfiddle for a demonstration. Unfortunately, the bootstrap folks only host the latest version. I thought I could just fetch the js + css from raw.github.com, like this:

<link rel="stylesheet" type="text/css" href="https://raw.github.com/twitter/bootstrap/v2.0.4/docs/assets/css/bootstrap.css">
<script type='text/javascript' src="https://raw.github.com/twitter/bootstrap/v2.0.4/docs/assets/js/bootstrap.js"></script>

The js worked fine, but the css didn't work at all. After some frustrated banging around, I figured out why: raw.github.com serves files as text/plain, and Chrome and Firefox refuse to load css stylesheets with that mimetype.

$ curl -s -D - https://raw.github.com/twitter/bootstrap/v2.0.4/docs/assets/css/bootstrap.css -o /dev/null |grep Content-Type
Content-Type: text/plain; charset=utf-8

This shows up in Chrome's JavaScript console:

Resource interpreted as Stylesheet but transferred with MIME type text/plain:
"https://raw.github.com/twitter/bootstrap/v2.0.4/docs/assets/css/bootstrap.css".

But only on the first page load. On subsequent loads, that URL is cached, and the error is not displayed, making this even more painful to debug.