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 {
6060}
6161
6262fn 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 ) => {
6565 let mut info_hashes = vec ! [ ] ;
6666
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+ } ) ?;
6874
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+ }
7677
7778 Ok ( info_hashes)
7879 }
You can’t perform that action at this time.
0 commit comments