http protocol: explicitly check for /scrape path

This commit is contained in:
Joakim Frostegård 2022-08-01 14:35:05 +02:00
parent 1b5fbe8775
commit ffc5dc5227

View file

@ -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"))
}
}