1- use crate :: headers:: { HeaderName , HeaderValue , Headers , ToHeaderValues , IF_MODIFIED_SINCE } ;
1+ use crate :: headers:: { HeaderName , HeaderValue , Headers , ToHeaderValues , IF_UNMODIFIED_SINCE } ;
22use crate :: utils:: { fmt_http_date, parse_http_date} ;
33
44use std:: fmt:: Debug ;
@@ -52,7 +52,7 @@ impl IfUnmodifiedSince {
5252
5353 /// Create an instance of `IfUnmodifiedSince` from a `Headers` instance.
5454 pub fn from_headers ( headers : impl AsRef < Headers > ) -> crate :: Result < Option < Self > > {
55- let headers = match headers. as_ref ( ) . get ( IF_MODIFIED_SINCE ) {
55+ let headers = match headers. as_ref ( ) . get ( IF_UNMODIFIED_SINCE ) {
5656 Some ( headers) => headers,
5757 None => return Ok ( None ) ,
5858 } ;
@@ -67,12 +67,12 @@ impl IfUnmodifiedSince {
6767
6868 /// Insert a `HeaderName` + `HeaderValue` pair into a `Headers` instance.
6969 pub fn apply ( & self , mut headers : impl AsMut < Headers > ) {
70- headers. as_mut ( ) . insert ( IF_MODIFIED_SINCE , self . value ( ) ) ;
70+ headers. as_mut ( ) . insert ( IF_UNMODIFIED_SINCE , self . value ( ) ) ;
7171 }
7272
7373 /// Get the `HeaderName`.
7474 pub fn name ( & self ) -> HeaderName {
75- IF_MODIFIED_SINCE
75+ IF_UNMODIFIED_SINCE
7676 }
7777
7878 /// Get the `HeaderValue`.
@@ -117,7 +117,7 @@ mod test {
117117 #[ test]
118118 fn bad_request_on_parse_error ( ) -> crate :: Result < ( ) > {
119119 let mut headers = Headers :: new ( ) ;
120- headers. insert ( IF_MODIFIED_SINCE , "<nori ate the tag. yum.>" ) ;
120+ headers. insert ( IF_UNMODIFIED_SINCE , "<nori ate the tag. yum.>" ) ;
121121 let err = IfUnmodifiedSince :: from_headers ( headers) . unwrap_err ( ) ;
122122 assert_eq ! ( err. status( ) , 400 ) ;
123123 Ok ( ( ) )
0 commit comments