@@ -139,30 +139,30 @@ def not_modified_response(env, etag)
139139 # Returns a 403 Forbidden response tuple
140140 def forbidden_response ( env )
141141 if head_request? ( env )
142- [ 403 , { "Content-Type " => "text/plain" , "Content-Length " => "0" } , [ ] ]
142+ [ 403 , { "content-type " => "text/plain" , "content-length " => "0" } , [ ] ]
143143 else
144- [ 403 , { "Content-Type " => "text/plain" , "Content-Length " => "9" } , [ "Forbidden" ] ]
144+ [ 403 , { "content-type " => "text/plain" , "content-length " => "9" } , [ "Forbidden" ] ]
145145 end
146146 end
147147
148148 # Returns a 404 Not Found response tuple
149149 def not_found_response ( env )
150150 if head_request? ( env )
151- [ 404 , { "Content-Type " => "text/plain" , "Content-Length " => "0" , "X-Cascade " => "pass" } , [ ] ]
151+ [ 404 , { "content-type " => "text/plain" , "content-length " => "0" , "x-cascade " => "pass" } , [ ] ]
152152 else
153- [ 404 , { "Content-Type " => "text/plain" , "Content-Length " => "9" , "X-Cascade " => "pass" } , [ "Not found" ] ]
153+ [ 404 , { "content-type " => "text/plain" , "content-length " => "9" , "x-cascade " => "pass" } , [ "Not found" ] ]
154154 end
155155 end
156156
157157 def method_not_allowed_response
158- [ 405 , { "Content-Type " => "text/plain" , "Content-Length " => "18" } , [ "Method Not Allowed" ] ]
158+ [ 405 , { "content-type " => "text/plain" , "content-length " => "18" } , [ "Method Not Allowed" ] ]
159159 end
160160
161161 def precondition_failed_response ( env )
162162 if head_request? ( env )
163- [ 412 , { "Content-Type " => "text/plain" , "Content-Length " => "0" , "X-Cascade " => "pass" } , [ ] ]
163+ [ 412 , { "content-type " => "text/plain" , "content-length " => "0" , "x-cascade " => "pass" } , [ ] ]
164164 else
165- [ 412 , { "Content-Type " => "text/plain" , "Content-Length " => "19" , "X-Cascade " => "pass" } , [ "Precondition Failed" ] ]
165+ [ 412 , { "content-type " => "text/plain" , "content-length " => "19" , "x-cascade " => "pass" } , [ "Precondition Failed" ] ]
166166 end
167167 end
168168
@@ -171,7 +171,7 @@ def precondition_failed_response(env)
171171 def javascript_exception_response ( exception )
172172 err = "#{ exception . class . name } : #{ exception . message } \n (in #{ exception . backtrace [ 0 ] } )"
173173 body = "throw Error(#{ err . inspect } )"
174- [ 200 , { "Content-Type " => "application/javascript" , "Content-Length " => body . bytesize . to_s } , [ body ] ]
174+ [ 200 , { "content-type " => "application/javascript" , "content-length " => body . bytesize . to_s } , [ body ] ]
175175 end
176176
177177 # Returns a CSS response that hides all elements on the page and
@@ -224,7 +224,7 @@ def css_exception_response(exception)
224224 }
225225 CSS
226226
227- [ 200 , { "Content-Type " => "text/css; charset=utf-8" , "Content-Length " => body . bytesize . to_s } , [ body ] ]
227+ [ 200 , { "content-type " => "text/css; charset=utf-8" , "content-length " => body . bytesize . to_s } , [ body ] ]
228228 end
229229
230230 # Escape special characters for use inside a CSS content("...") string
@@ -245,18 +245,18 @@ def cache_headers(env, etag)
245245 headers = { }
246246
247247 # Set caching headers
248- headers [ "Cache-Control " ] = "public"
249- headers [ "ETag " ] = %("#{ etag } ")
248+ headers [ "cache-control " ] = "public"
249+ headers [ "etag " ] = %("#{ etag } ")
250250
251251 # If the request url contains a fingerprint, set a long
252252 # expires on the response
253253 if path_fingerprint ( env [ "PATH_INFO" ] )
254- headers [ "Cache-Control " ] += ", max-age=31536000"
254+ headers [ "cache-control " ] += ", max-age=31536000"
255255
256256 # Otherwise set `must-revalidate` since the asset could be modified.
257257 else
258- headers [ "Cache-Control " ] += ", must-revalidate"
259- headers [ "Vary " ] = "Accept-Encoding"
258+ headers [ "cache-control " ] += ", must-revalidate"
259+ headers [ "vary " ] = "Accept-Encoding"
260260 end
261261
262262 headers
@@ -266,15 +266,15 @@ def headers(env, asset, length)
266266 headers = { }
267267
268268 # Set content length header
269- headers [ "Content-Length " ] = length . to_s
269+ headers [ "content-length " ] = length . to_s
270270
271271 # Set content type header
272272 if type = asset . content_type
273273 # Set charset param for text/* mime types
274274 if type . start_with? ( "text/" ) && asset . charset
275275 type += "; charset=#{ asset . charset } "
276276 end
277- headers [ "Content-Type " ] = type
277+ headers [ "content-type " ] = type
278278 end
279279
280280 headers . merge ( cache_headers ( env , asset . etag ) )
0 commit comments