Set charset in content-type header

This commit is contained in:
2023-12-21 08:40:09 +11:00
parent fa665e1954
commit ec442190f4
2 changed files with 3 additions and 7 deletions

View File

@@ -22,10 +22,6 @@ module Adamantium
handle_exception ROM::TupleCountMismatchError => :not_found handle_exception ROM::TupleCountMismatchError => :not_found
handle_exception StandardError => :handle_error handle_exception StandardError => :handle_error
config.default_headers = {
"Content-Type" => "application/octet-stream"
}
def cache(key:, content:) def cache(key:, content:)
cacher.call(key: key, content: content, expiry: TimeMath.min.advance(Time.now, +10)) cacher.call(key: key, content: content, expiry: TimeMath.min.advance(Time.now, +10))
end end

View File

@@ -20,9 +20,9 @@ end
require "adamantium/middleware/header_fix" require "adamantium/middleware/header_fix"
use Adamantium::Middleware::HeaderFix do |headers, env| use Adamantium::Middleware::HeaderFix do |headers, env|
if env["REQUEST_METHOD"] == "HEAD" # if env["REQUEST_METHOD"] == "HEAD"
headers['Content-Type'] = "text/html" headers['Content-Type'] = "text/html; charset=utf-8"
end # end
end end
run Hanami.app run Hanami.app