Skip to content

Commit

Permalink
Mail::Header: cache charset properly
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan committed Mar 10, 2012
1 parent 9beb079 commit 4668309
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/mail/header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ def []=(name, value)
# Need to insert in correct order for trace fields
self.fields << Field.new(name.to_s, value, charset)
end
if dasherize(fn) == "content-type"
# Update charset if specified in Content-Type
params = self[:content_type].parameters rescue nil
@charset = params && params[:charset]
end
end

def charset
params = self[:content_type].parameters rescue nil
if params
params[:charset]
else
@charset
end
@charset
end

def charset=(val)
Expand Down

0 comments on commit 4668309

Please # to comment.