diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-10-26 20:30:04 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-10-26 20:30:04 +0900 |
commit | ff7e81f4aba4995633b91adf0bbb8e45a6357444 (patch) | |
tree | e9101df02c26d52c60597d325e6aae6da0211651 /lib/plum/http_connection.rb | |
parent | 1f541f2a210c32fbb094d3948347940cb107e478 (diff) | |
parent | 462b3646c9026e36d84d5c03caa7b63345d64f9f (diff) | |
download | plum-ff7e81f4aba4995633b91adf0bbb8e45a6357444.tar.gz |
Merge branch 'frozen-string-literal'
Diffstat (limited to 'lib/plum/http_connection.rb')
-rw-r--r-- | lib/plum/http_connection.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/plum/http_connection.rb b/lib/plum/http_connection.rb index 9af246d..1c30e6e 100644 --- a/lib/plum/http_connection.rb +++ b/lib/plum/http_connection.rb @@ -1,3 +1,4 @@ +# -*- frozen-string-literal: true -*- using Plum::BinaryString module Plum @@ -7,7 +8,7 @@ module Plum def initialize(sock, local_settings = {}) require "http/parser" @_headers = nil - @_body = "" + @_body = String.new @_http_parser = setup_parser @sock = sock super(@sock.method(:write), local_settings) @@ -65,12 +66,11 @@ module Plum process_first_request } - resp = "" - resp << "HTTP/1.1 101 Switching Protocols\r\n" - resp << "Connection: Upgrade\r\n" - resp << "Upgrade: h2c\r\n" - resp << "Server: plum/#{Plum::VERSION}\r\n" - resp << "\r\n" + resp = "HTTP/1.1 101 Switching Protocols\r\n" + "Connection: Upgrade\r\n" + "Upgrade: h2c\r\n" + "Server: plum/#{Plum::VERSION}\r\n" + "\r\n" @sock.write(resp) end |