mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Ability to optionally disable powered-by header (#449)
This commit is contained in:
parent
73045bb138
commit
f3f7e319ae
4 changed files with 16 additions and 1 deletions
|
@ -22,6 +22,7 @@ module Kemal
|
|||
property always_rescue, server : HTTP::Server?, extra_options, shutdown_message
|
||||
property serve_static : (Bool | Hash(String, Bool))
|
||||
property static_headers : (HTTP::Server::Response, String, File::Stat -> Void)?
|
||||
property powered_by_header : Bool = true
|
||||
|
||||
def initialize
|
||||
@host_binding = "0.0.0.0"
|
||||
|
|
|
@ -7,7 +7,7 @@ module Kemal
|
|||
INSTANCE = new
|
||||
|
||||
def call(context : HTTP::Server::Context)
|
||||
context.response.headers.add "X-Powered-By", "Kemal"
|
||||
context.response.headers.add "X-Powered-By", "Kemal" if Kemal.config.powered_by_header
|
||||
context.response.content_type = "text/html" unless context.response.headers.has_key?("Content-Type")
|
||||
call_next context
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue