Skip to content

Commit

Permalink
Quick tidy-up
Browse files Browse the repository at this point in the history
  • Loading branch information
oesmith committed Oct 5, 2012
1 parent b2cdc06 commit 00ea714
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/puffing-billy/proxy_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ def receive_data(data)
@parser << data
rescue HTTP::Parser::Error
if @parser.http_method == 'CONNECT'
# work-around for CONNECT requests until https://github.com/tmm1/http_parser.rb/pull/15 gets merged
@ssl = @header_data.split("\r\n").first.split(/\s+/)[1]
@parser = Http::Parser.new(self)
send_data("HTTP/1.0 200 Connection established\r\nProxy-agent: Puffing-Billy/0.0.0\r\n\r\n")
start_tls(:private_key_file => 'node/mitm.key', :cert_chain_file => 'node/mitm.crt')
else
close_connection
end
end
end
Expand Down

0 comments on commit 00ea714

Please sign in to comment.