lib/cuba.rb in cuba-3.2.0 vs lib/cuba.rb in cuba-3.3.0

- old
+ new

@@ -6,13 +6,11 @@ attr_accessor :status attr :body attr :headers - def initialize(status = nil, - headers = { "Content-Type" => "text/html; charset=utf-8" }) - + def initialize(status = nil, headers = {}) @status = status @headers = headers @body = [] @length = 0 end @@ -183,9 +181,10 @@ if res.status.nil? if res.body.empty? res.status = 404 else + res.headers["Content-Type"] ||= "text/html; charset=utf-8" res.status = 200 end end halt(res.finish)