diff --git a/matrix/homeserver.cc b/matrix/homeserver.cc index 1a7fb3131..e37273c28 100644 --- a/matrix/homeserver.cc +++ b/matrix/homeserver.cc @@ -934,7 +934,7 @@ noexcept // Since my host is on the canonical port, if other host has some // different port number, there is no possible match. - if(port(b) != m::canon_port) + if(port(b) && port(b) != m::canon_port) return false; // Both myself and input are using 8448; now the name has to match. diff --git a/matrix/resource.cc b/matrix/resource.cc index 599e1c11f..e453bbf3f 100644 --- a/matrix/resource.cc +++ b/matrix/resource.cc @@ -340,7 +340,7 @@ try "Required X-Matrix Authorization was not supplied" }; - if(x_matrix_verify_destination && !m::my_host(request.head.host)) + if(x_matrix_verify_destination && !m::self::host(request.head.host)) throw m::error { http::UNAUTHORIZED, "M_NOT_MY_HOST", @@ -351,7 +351,7 @@ try const m::request object { request.x_matrix.origin, - request.head.host, + rstrip(request.head.host, ":8448"), method.name, request.head.uri, request.content