Skip to content

Commit 7d114e8

Browse files
committed
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
1 parent 994cd1f commit 7d114e8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.htaccess

+3-1
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,13 @@ Options -MultiViews
124124
AddType audio/mp4 m4a f4a f4b
125125
AddType audio/ogg oga ogg opus
126126

127+
# Data interchange
128+
AddType application/json json map
129+
127130
# JavaScript
128131
# Normalize to standard type (it's sniffed in IE anyways):
129132
# http://tools.ietf.org/html/rfc4329#section-7.2
130133
AddType application/javascript js
131-
AddType application/json json
132134

133135
# Video
134136
AddType video/mp4 f4v f4p m4v mp4

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### HEAD
22

3+
* Serve source map files with the `application/json` Content-Type.
34
* Make `RewriteCond`s for `example.com → www.example.com` more permissive
45
([#11](https://github.com/h5bp/server-configs-apache/issues/11)).
56
* Add configs for Ogg Opus audio files

0 commit comments

Comments
 (0)