From 7d114e8eeacadaf30768d60f7f522b3558e83676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20Mari=C8=99?= Date: Sun, 29 Dec 2013 12:57:46 +0200 Subject: [PATCH] Serve source map files as `application/json` Developer tools don't actually care what `Content-Type` source map files are served with. However, mapping their file extension (`.map`) to the `application/json` media type, ensures that they will be served compressed and their character encoding will be UTF-8. See also: * Source Map Revision 3 Proposal https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/ * Introduction to JavaScript Source Maps http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ * How CSS source maps work https://developers.google.com/chrome-developer-tools/docs/css-preprocessors#toc-how-css-source-maps-work * What MIME-type should I use for source map files? http://stackoverflow.com/a/19912684 --- .htaccess | 4 +++- CHANGELOG.md | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 0784375f..6cd1a7d2 100644 --- a/.htaccess +++ b/.htaccess @@ -124,11 +124,13 @@ Options -MultiViews AddType audio/mp4 m4a f4a f4b AddType audio/ogg oga ogg opus + # Data interchange + AddType application/json json map + # JavaScript # Normalize to standard type (it's sniffed in IE anyways): # http://tools.ietf.org/html/rfc4329#section-7.2 AddType application/javascript js - AddType application/json json # Video AddType video/mp4 f4v f4p m4v mp4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3210ed30..6205daac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### HEAD +* Serve source map files with the `application/json` Content-Type. * Make `RewriteCond`s for `example.com → www.example.com` more permissive ([#11](https://github.com/h5bp/server-configs-apache/issues/11)). * Add configs for Ogg Opus audio files