Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Response: Default to UTF-8 and text/html

  • Loading branch information...
commit 905b6ba849a2c5ad128b770069363c2e27da60f1 1 parent db5f2c9
@mneumann authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/wee/response.rb
View
3  lib/wee/response.rb
@@ -10,10 +10,13 @@ class Response < Rack::Response
class GenericResponse < Response
EXPIRE_OFFSET = 3600*24*365*20 # 20 years
EXPIRES_HEADER = 'Expires'.freeze
+ CONTENT_TYPE_HEADER = 'Content-Type'.freeze
+ CONTENT_TYPE = 'text/html; charset=UTF-8'.freeze
def initialize(*args)
super
self[EXPIRES_HEADER] ||= (Time.now + EXPIRE_OFFSET).rfc822
+ self[CONTENT_TYPE_HEADER] = CONTENT_TYPE
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.