File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
src/http/axum_implementation/requests Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -60,19 +60,20 @@ impl TryFrom<Query> for Scrape {
60
60
}
61
61
62
62
fn extract_info_hashes ( query : & Query ) -> Result < Vec < InfoHash > , ParseScrapeQueryError > {
63
- match query. get_param ( INFO_HASH_SCRAPE_PARAM ) {
64
- Some ( raw_param ) => {
63
+ match query. get_param_vec ( INFO_HASH_SCRAPE_PARAM ) {
64
+ Some ( raw_params ) => {
65
65
let mut info_hashes = vec ! [ ] ;
66
66
67
- // todo: multiple infohashes
67
+ for raw_param in raw_params {
68
+ let info_hash =
69
+ percent_decode_info_hash ( & raw_param) . map_err ( |err| ParseScrapeQueryError :: InvalidInfoHashParam {
70
+ param_name : INFO_HASH_SCRAPE_PARAM . to_owned ( ) ,
71
+ param_value : raw_param. clone ( ) ,
72
+ source : Located ( err) . into ( ) ,
73
+ } ) ?;
68
74
69
- let info_hash = percent_decode_info_hash ( & raw_param) . map_err ( |err| ParseScrapeQueryError :: InvalidInfoHashParam {
70
- param_name : INFO_HASH_SCRAPE_PARAM . to_owned ( ) ,
71
- param_value : raw_param. clone ( ) ,
72
- source : Located ( err) . into ( ) ,
73
- } ) ?;
74
-
75
- info_hashes. push ( info_hash) ;
75
+ info_hashes. push ( info_hash) ;
76
+ }
76
77
77
78
Ok ( info_hashes)
78
79
}
You can’t perform that action at this time.
0 commit comments