From ffc5dc5227d8e6007541f8688523e3a1142332ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Mon, 1 Aug 2022 14:35:05 +0200 Subject: [PATCH] http protocol: explicitly check for /scrape path --- aquatic_http_protocol/src/request.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aquatic_http_protocol/src/request.rs b/aquatic_http_protocol/src/request.rs index 61b1dd2..61abdb1 100644 --- a/aquatic_http_protocol/src/request.rs +++ b/aquatic_http_protocol/src/request.rs @@ -300,10 +300,12 @@ impl Request { Ok(Request::Announce(AnnounceRequest::from_query_string( query_string, )?)) - } else { + } else if location == "/scrape" { Ok(Request::Scrape(ScrapeRequest::from_query_string( query_string, )?)) + } else { + Err(anyhow::anyhow!("Path must be /announce or /scrape")) } }