From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id D33701F47C for ; Sat, 7 Jan 2023 21:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1673128031; bh=PrcQJocsenLKjYlPC4QmxLTZkrdbLdy897ZmCCMmfuo=; h=From:To:Subject:Date:From; b=20P/GYBo27NyHFjElkC1FFFKzl62sRrkAK1k9UJHy0h+cbuXe8m1F03lpnTCcX6tg 4tqc+Cio8ji/+S29LLIzQL+L2PQBOpgJ3KxEtEWX2iuZZz3Lr+c/RHmxUxXHYlAxxd JTnFtulJCu2dJ/v2c3rUl9Q0UlWp5AMezVVKQp4M= From: Eric Wong To: mwrap-public@80x24.org Subject: [PATCH] mwrap_rack: lowercase response headers for Rack 3 Date: Sat, 7 Jan 2023 21:47:12 +0000 Message-Id: <20230107214712.2463926-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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