From 82bc4be5e140ddeb8a5ebe1ee2d14dda2475184a Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 16 Mar 2020 07:44:11 -0700 Subject: [PATCH] ircd::m::fed: Improve conditions to bail before redirect. --- matrix/fed.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/matrix/fed.cc b/matrix/fed.cc index 475b6afdc..d124fc6e0 100644 --- a/matrix/fed.cc +++ b/matrix/fed.cc @@ -1683,10 +1683,18 @@ try break; } + // Indirection code, but no location response header + if(!location) + return origin; + // Redirection; carry over the new target by copying it because it's // in the buffer which we'll be overwriting for the new request. carry = unique_mutable_buffer{location}; uri = string_view{carry}; + + // Indirection code, bad location header. + if(!uri.path || !uri.remote) + return origin; } const json::string &m_server