1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Switch to constants to check Expect

This commit is contained in:
Evan Phoenix 2016-07-24 22:10:13 -07:00
parent 5ec232d1d4
commit 90a962185e
2 changed files with 5 additions and 2 deletions

View file

@ -219,7 +219,10 @@ module Puma
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

View file

@ -404,8 +404,8 @@ module Puma
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]