diff options
Diffstat (limited to 'lib/mogilefs/http_file.rb')
-rw-r--r-- | lib/mogilefs/http_file.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/mogilefs/http_file.rb b/lib/mogilefs/http_file.rb index c7949a5..a58801a 100644 --- a/lib/mogilefs/http_file.rb +++ b/lib/mogilefs/http_file.rb @@ -54,7 +54,7 @@ class MogileFS::HTTPFile < StringIO "Content-Length: #{file_size}\r\n\r\n") rv = input ? MogileFS.io.copy_stream(@active = input, sock) : yield(sock) else - trailers = @md5 ? "Trailer: Content-MD5\r\n" : "" + trailers = @md5 ? "Trailer: Content-MD5\r\n".freeze : "".freeze sock.write("PUT #{uri.request_uri} HTTP/1.1\r\n" \ "Host: #{host_with_port}\r\n#{trailers}" \ "Transfer-Encoding: chunked\r\n\r\n") @@ -143,14 +143,14 @@ class MogileFS::HTTPFile < StringIO end put = Net::HTTP::Put.new(uri.path) - put["Content-Type"] = "application/octet-stream".freeze + put["Content-Type".freeze] = "application/octet-stream".freeze if md5 = @opts[:content_md5] if md5.respond_to?(:call) md5 = md5.call.strip elsif md5 == :trailer - md5 = [ Digest::MD5.digest(string) ].pack("m").chomp! + md5 = [ Digest::MD5.digest(string) ].pack("m".freeze).chomp! end - put["Content-MD5"] = md5 + put["Content-MD5".freeze] = md5 end put.body = string res = @opts[:nhp_put].request(uri, put) |