aquatic http protocol: ScrapeRequest::to_bytes(): use urlencode_20_bytes

This commit is contained in:
Joakim Frostegård 2020-07-20 22:35:08 +02:00
parent ca935b7d46
commit dae83a1835

View file

@ -93,11 +93,7 @@ impl ScrapeRequest {
}
bytes.extend_from_slice(b"info_hash=");
for b in info_hash.0.iter() {
bytes.push(b'%');
bytes.extend_from_slice(format!("{:02x}", b).as_bytes());
}
urlencode_20_bytes(info_hash.0, &mut bytes);
first = false;
}