From: Eric Wong <e@80x24.org>
To: mwrap-public@80x24.org
Subject: [PATCH] mwrap_rack: lowercase response headers for Rack 3
Date: Sat, 7 Jan 2023 21:47:12 +0000 [thread overview]
Message-ID: <20230107214712.2463926-1-e@80x24.org> (raw)
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 >#{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
reply other threads:[~2023-01-07 21:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://80x24.org/mwrap/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230107214712.2463926-1-e@80x24.org \
--to=e@80x24.org \
--cc=mwrap-public@80x24.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).