提交 8e105a55 编写于 作者: A Aaron Patterson

rack 1.6 encodes the filenames in posts correctly now

上级 3ef98a14
......@@ -27,7 +27,7 @@ def initialize(hash) # :nodoc:
@tempfile = hash[:tempfile]
raise(ArgumentError, ':tempfile is required') unless @tempfile
@original_filename = encode_filename(hash[:filename])
@original_filename = hash[:filename]
@content_type = hash[:type]
@headers = hash[:head]
end
......@@ -66,13 +66,6 @@ def size
def eof?
@tempfile.eof?
end
private
def encode_filename(filename)
# Encode the filename in the utf8 encoding, unless it is nil
filename.force_encoding(Encoding::UTF_8).encode! if filename
end
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册