Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add X-SourceMap header to server

  • Loading branch information...
commit 84c47f81cdb466564ee2df9fb013c9ff73261fb0 1 parent 5771f9f
Joshua Peek josh authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/sprockets/server.rb
5 lib/sprockets/server.rb
View
@@ -204,6 +204,11 @@ def headers(env, asset, length)
headers["Content-Type"] = asset.content_type
headers["Content-Length"] = length.to_s
+ # Source Map
+ if asset.is_a?(BundledAsset)
+ headers["X-SourceMap"] = "#{env["SCRIPT_NAME"]}#{env["PATH_INFO"]}.map"
+ end
+
# Set caching headers
headers["Cache-Control"] = "public"
headers["Last-Modified"] = asset.mtime.httpdate
Please sign in to comment.
Something went wrong with that request. Please try again.