mwrap user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [PATCH] mwrap_rack: lowercase response headers for Rack 3
@ 2023-01-07 21:47 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-01-07 21:47 UTC (permalink / raw)
  To: mwrap-public

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
           "<body><p><a href=\"each/#{n}\">allocations &gt;#{n} bytes</a>" \
           "<p><a href=\"#{u}\">#{u}</a>" \
           "</body></html>\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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-07 21:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-07 21:47 [PATCH] mwrap_rack: lowercase response headers for Rack 3 Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mwrap.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).