From 40893ed4ddc5d92cce36ee951e9c7ae67b96f41a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 7 Jan 2023 21:47:12 +0000 Subject: mwrap_rack: lowercase response headers for Rack 3 Rack 3 requires lowercase headers, and they work with any Rack <=2.x version. --- lib/mwrap_rack.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/mwrap_rack.rb b/lib/mwrap_rack.rb index c777a78..1bd00ac 100644 --- a/lib/mwrap_rack.rb +++ b/lib/mwrap_rack.rb @@ -22,10 +22,10 @@ class MwrapRack module HtmlResponse # :nodoc: def response [ 200, { - 'Expires' => 'Fri, 01 Jan 1980 00:00:00 GMT', - 'Pragma' => 'no-cache', - 'Cache-Control' => 'no-cache, max-age=0, must-revalidate', - 'Content-Type' => 'text/html; charset=UTF-8', + 'expires' => 'Fri, 01 Jan 1980 00:00:00 GMT', + 'pragma' => 'no-cache', + 'cache-control' => 'no-cache, max-age=0, must-revalidate', + 'content-type' => 'text/html; charset=UTF-8', }, self ] end end @@ -90,7 +90,7 @@ class MwrapRack end def r404 # :nodoc: - [404,{'Content-Type'=>'text/plain'},["Not found\n"]] + [404,{'content-type'=>'text/plain'},["Not found\n"]] end # The standard Rack application endpoint for MwrapRack @@ -111,7 +111,7 @@ class MwrapRack "

allocations >#{n} bytes" \ "

#{u}" \ "\n") - [ 200, {'Content-Type'=>'text/html','Content-Length'=>-b.size.to_s},[b]] + [ 200, {'content-type'=>'text/html','content-length'=>-b.size.to_s},[b]] else r404 end -- cgit v1.2.3-24-ge0c7