Skip to content

Commit a3cc261

Browse files
committed
http/server: http/1.0 ALPN has been registered at IANA
1 parent 88298c8 commit a3cc261

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

http/server.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ local function wrap_socket(self, socket, timeout)
7171
version = 2
7272
elseif proto == "http/1.1" and (version == nil or version < 2) then
7373
version = 1.1
74+
elseif proto == "http/1.0" and (version == nil or version == 1.0) then
75+
version = 1.0
7476
else
7577
return nil, "unexpected ALPN protocol: " .. proto, ce.EILSEQNOSUPPORT
7678
end
@@ -198,7 +200,8 @@ local function alpn_select(ssl, protos, version)
198200
if ssl:getVersion() >= openssl_ssl.TLS1_2_VERSION or version == 2 then
199201
return proto
200202
end
201-
elseif proto == "http/1.1" and (version == nil or version == 1.1) then
203+
elseif (proto == "http/1.1" and (version == nil or version == 1.1))
204+
or (proto == "http/1.0" and (version == nil or version == 1.0)) then
202205
return proto
203206
end
204207
end

0 commit comments

Comments
 (0)