Move unreachable debug statement

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2024-07-26 18:47:24 +02:00
parent 890eb8fba5
commit 0c1627e726
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -62,12 +62,12 @@ async fn hooks_inner(req: Request<Incoming>, secret: &str) -> Result<Hook, Error
whole_body.reader().read_to_end(&mut payload)?; whole_body.reader().read_to_end(&mut payload)?;
if let Some(val) = headers.get("X-Gitlab-Token") { if let Some(val) = headers.get("X-Gitlab-Token") {
debug!("Found Gitlab payload");
if secret != val { if secret != val {
return Err(Error::InvalidSecret); return Err(Error::InvalidSecret);
} }
let hook: GitlabHook = serde_json::from_slice(&payload[..])?; let hook: GitlabHook = serde_json::from_slice(&payload[..])?;
debug!("Found Gitlab payload");
return Ok(Hook::Gitlab(hook)); return Ok(Hook::Gitlab(hook));
} }
@ -86,8 +86,8 @@ async fn hooks_inner(req: Request<Incoming>, secret: &str) -> Result<Hook, Error
} }
let hook: ForgejoHook = serde_json::from_slice(&payload[..])?; let hook: ForgejoHook = serde_json::from_slice(&payload[..])?;
return Ok(Hook::Forgejo(hook));
debug!("Found Forgejo payload."); debug!("Found Forgejo payload.");
return Ok(Hook::Forgejo(hook));
} }
// No match found for the payload // No match found for the payload