Skip to content
Merged
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
7 changes: 6 additions & 1 deletion http/h1_stream.lua
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,19 @@ function stream_methods:write_headers(headers, end_stream, timeout)
if self.state == "idle" then
error("cannot write headers when stream is idle")
end
status_code = headers:get(":status")
-- RFC 2616 Section 8.2.3:
-- An origin server ... MUST NOT send a 100 (Continue) response if such a request comes from an HTTP/1.0 (or earlier) client
if status_code == "100" and self.peer_version < 1.1 then
return error("Status code 100 (continue) MUST NOT be sent in reply to a request from a HTTP/1.0 client")
end
-- Make sure we're at the front of the pipeline
if self.connection.pipeline:peek() ~= self then
if not self.pipeline_cond:wait(deadline and (deadline-monotime)) then
return nil, ce.ETIMEDOUT
end
assert(self.connection.pipeline:peek() == self)
end
status_code = headers:get(":status")
if status_code then
-- Should send status line
local reason_phrase = reason_phrases[status_code]
Expand Down