Fix HEAD response header for brid.gy

This commit is contained in:
2023-12-20 22:35:27 +11:00
parent 019b1bab4b
commit a7678abe92
6 changed files with 41 additions and 2 deletions

View File

@@ -15,7 +15,14 @@ use Rack::Session::Cookie,
require "rack/rewrite"
use Rack::Rewrite do
# remove trailing slashes
# r302 %r{(/.*)/(\?.*)?$}, "$1$2"
r302 %r{(/.*)/(\?.*)?$}, "$1$2"
end
require "adamantium/middleware/header_fix"
use Adamantium::Middleware::HeaderFix do |headers, env|
if env["REQUEST_METHOD"] == "HEAD"
headers['Content-Type'] = "text/html"
end
end
run Hanami.app