2016-07-17 15:11:26 +00:00
|
|
|
module Kemal
|
|
|
|
# Kemal::InitHandler is the first handler thus initializes the context with default values such as
|
|
|
|
# Content-Type, X-Powered-By.
|
|
|
|
class InitHandler < HTTP::Handler
|
|
|
|
INSTANCE = new
|
|
|
|
|
|
|
|
def call(context)
|
|
|
|
context.response.headers.add "X-Powered-By", "Kemal"
|
2016-07-17 15:15:12 +00:00
|
|
|
call_next context
|
2016-07-17 16:04:03 +00:00
|
|
|
context.response.content_type = "text/html"
|
2016-07-17 15:11:26 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|