ircd:Ⓜ️:fed: Improve conditions to bail before redirect.

This commit is contained in:
Jason Volk 2020-03-16 07:44:11 -07:00
parent 006aa4f0e6
commit 82bc4be5e1
1 changed files with 8 additions and 0 deletions

View File

@ -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