diff --git a/hyper/http20/connection.py b/hyper/http20/connection.py index b8be292b..40dae298 100644 --- a/hyper/http20/connection.py +++ b/hyper/http20/connection.py @@ -505,7 +505,8 @@ def putrequest(self, method, selector, **kwargs): # ":path". We can set all of these now. s.add_header(":method", method) s.add_header(":scheme", "https" if self.secure else "http") - s.add_header(":authority", self.host) + port = "" if ((self.secure and self.port == 443) or (not self.secure and self.port == 80)) else (":" + str(self.port)) + s.add_header(":authority", self.host + port) s.add_header(":path", selector) # Save the stream.