Skip to content

Commit

Permalink
Use HTTP.format_time method
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Apr 3, 2024
1 parent a9bd09b commit 3f6a421
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/kemal/init_handler.cr
@@ -1,3 +1,5 @@
require "http"

module Kemal
# Initializes the context with default values, such as
# *Content-Type* or *X-Powered-By* headers.
Expand All @@ -9,7 +11,7 @@ module Kemal
def call(context : HTTP::Server::Context)
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")
context.response.headers.add "Date", Time.utc.to_rfc2822
context.response.headers.add "Date", HTTP.format_time(Time.utc)
call_next context
end
end
Expand Down

0 comments on commit 3f6a421

Please sign in to comment.