This commit is contained in:
Maximilian Hils 2021-06-09 23:59:44 +02:00
parent de0951462d
commit d47eb7556a
2 changed files with 3 additions and 2 deletions

View File

@ -172,7 +172,7 @@ class TlsConfig:
server.alpn_offers = tuple(client.alpn_offers)
else:
server.alpn_offers = tuple(x for x in client.alpn_offers if x != b"h2")
elif client.tls_established:
elif client.tls:
# We would perfectly support HTTP/1 -> HTTP/2, but we want to keep things on the same protocol version.
# There are some edge cases where we want to mirror the regular server's behavior accurately,
# for example header capitalization.

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import fileinput
import sys
import re
if __name__ == "__main__":
if len(sys.argv) < 3:
@ -10,7 +11,7 @@ if __name__ == "__main__":
port = sys.argv[1]
matches = False
for line in fileinput.input(sys.argv[2:]):
if line.startswith("["):
if re.match(r"^\[|(\d+\.){3}", line):
matches = port in line
if matches:
print(line, end="")