Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/net-http2/socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def self.proxy_tcp_socket(uri, options)
# So we’ll keep HTTP/1.1
http_version = '1.1'

buf = "CONNECT #{uri.host}:#{uri.port} HTTP/#{http_version}\r\n"
buf = String.new
buf << "CONNECT #{uri.host}:#{uri.port} HTTP/#{http_version}\r\n"
buf << "Host: #{uri.host}:#{uri.port}\r\n"
if proxy_user
credential = ["#{proxy_user}:#{proxy_pass}"].pack('m')
Expand All @@ -87,7 +88,7 @@ def self.proxy_tcp_socket(uri, options)
private

def self.validate_proxy_response!(socket)
result = ''
result = String.new
loop do
line = socket.gets
break if !line || line.strip.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/net-http2/stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Stream
def initialize(options={})
@h2_stream = options[:h2_stream]
@headers = {}
@data = ''
@data = String.new
@request = nil
@async = false
@completed = false
Expand Down
1 change: 1 addition & 0 deletions spec/api/errors_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen-string-literal: false
require 'spec_helper'

describe "Errors" do
Expand Down
1 change: 1 addition & 0 deletions spec/api/sending_async_requests_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen-string-literal: false
require 'spec_helper'

describe "Sending async requests" do
Expand Down
1 change: 1 addition & 0 deletions spec/support/dummy_server.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen-string-literal: false
module NetHttp2

module Dummy
Expand Down