Skip to content

Commit

Permalink
Switch to constants to check Expect
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed Jul 25, 2016
1 parent 5ec232d commit 90a9621
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/puma/const.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ module Const

HTTP_VERSION = "HTTP_VERSION".freeze
HTTP_CONNECTION = "HTTP_CONNECTION".freeze
HTTP_EXPECT = "HTTP_EXPECT".freeze
CONTINUE = "100-continue".freeze

HTTP_11_100 = "HTTP/1.1 100 Continue\r\n\r\n".freeze
HTTP_11_200 = "HTTP/1.1 200 OK\r\n".freeze
HTTP_10_200 = "HTTP/1.0 200 OK\r\n".freeze

Expand Down
4 changes: 2 additions & 2 deletions lib/puma/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ def handle_check
def process_client(client, buffer)
begin

if client.env['HTTP_EXPECT'] == "100-continue"
client.io << "HTTP/1.1 100 Continue\r\n\r\n"
if client.env[HTTP_EXPECT] == CONTINUE
client.io << HTTP_11_100
end

clean_thread_locals = @options[:clean_thread_locals]
Expand Down

0 comments on commit 90a9621

Please sign in to comment.