@@ -73,7 +73,10 @@ impl Pipeline {
7373
7474 let pipeline_options = pipeline_options. unwrap_or_default ( ) ;
7575
76- let retry_policy = options. retry . to_policy ( pipeline_options. retry_headers ) ;
76+ let retry_policy = options. retry . to_policy (
77+ pipeline_options. retry_headers . clone ( ) ,
78+ & pipeline_options. retry_status_codes ,
79+ ) ;
7780 pipeline. push ( retry_policy) ;
7881
7982 pipeline. extend_from_slice ( & per_try_policies) ;
@@ -134,10 +137,8 @@ mod tests {
134137 use crate :: {
135138 error:: { Error , ErrorKind } ,
136139 http:: {
137- headers:: { Headers , RETRY_AFTER } ,
138- policies:: { PolicyResult , RetryHeaders } ,
139- BufResponse , FixedRetryOptions , JsonFormat , Method , Response , RetryOptions , StatusCode ,
140- Transport ,
140+ headers:: Headers , policies:: PolicyResult , BufResponse , FixedRetryOptions , JsonFormat ,
141+ Method , Response , RetryOptions , StatusCode , Transport ,
141142 } ,
142143 stream:: BytesStream ,
143144 Bytes ,
@@ -180,12 +181,7 @@ mod tests {
180181 transport : Some ( Transport :: with_policy ( Arc :: new ( Responder { } ) ) ) ,
181182 ..Default :: default ( )
182183 } ;
183- let pipeline_options = PipelineOptions {
184- retry_headers : RetryHeaders {
185- retry_headers : vec ! [ RETRY_AFTER ] ,
186- } ,
187- } ;
188- let pipeline = Pipeline :: new ( options, Vec :: new ( ) , Vec :: new ( ) , Some ( pipeline_options) ) ;
184+ let pipeline = Pipeline :: new ( options, Vec :: new ( ) , Vec :: new ( ) , None ) ;
189185 let mut request = Request :: new ( "http://localhost" . parse ( ) . unwrap ( ) , Method :: Get ) ;
190186 let raw_response = pipeline
191187 . send ( & Context :: default ( ) , & mut request, None )
0 commit comments