Skip to content
This repository
Browse code

Add X-SourceMap header to server

  • Loading branch information...
commit 84c47f81cdb466564ee2df9fb013c9ff73261fb0 1 parent 5771f9f
Joshua Peek authored March 22, 2012

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. 5  lib/sprockets/server.rb
5  lib/sprockets/server.rb
@@ -204,6 +204,11 @@ def headers(env, asset, length)
204 204
           headers["Content-Type"]   = asset.content_type
205 205
           headers["Content-Length"] = length.to_s
206 206
 
  207
+          # Source Map
  208
+          if asset.is_a?(BundledAsset)
  209
+            headers["X-SourceMap"] = "#{env["SCRIPT_NAME"]}#{env["PATH_INFO"]}.map"
  210
+          end
  211
+
207 212
           # Set caching headers
208 213
           headers["Cache-Control"]  = "public"
209 214
           headers["Last-Modified"]  = asset.mtime.httpdate

0 notes on commit 84c47f8

Please sign in to comment.
Something went wrong with that request. Please try again.