diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-09-28 21:22:28 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-09-28 21:22:28 +0900 |
commit | d2f6b5d9a2a27852522da18b209bf6f2b34302b5 (patch) | |
tree | e63a074fc3c7b68c3ebbc1f0cb3ff4ef3280cdc3 /lib/plum/http_connection.rb | |
parent | 53c3791ae6ce6f4c7c9e2ef7148ad5bb25976a5f (diff) | |
download | plum-d2f6b5d9a2a27852522da18b209bf6f2b34302b5.tar.gz |
enable frozen-string-literal option (for Ruby 2.3.0-dev)
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 61445af..45c6486 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 @@ -6,7 +7,7 @@ module Plum require "http/parser" super @_headers = nil - @_body = "" + @_body = String.new @_http_parser = setup_parser end @@ -49,12 +50,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" io.write(resp) end |