Permalink
Browse files

Response: Default to UTF-8 and text/html

  • Loading branch information...
1 parent db5f2c9 commit 905b6ba849a2c5ad128b770069363c2e27da60f1 @mneumann committed Sep 27, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/wee/response.rb
View
@@ -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

0 comments on commit 905b6ba

Please sign in to comment.