1
- use crate :: headers:: { HeaderName , HeaderValue , Headers , ToHeaderValues , IF_MODIFIED_SINCE } ;
1
+ use crate :: headers:: { HeaderName , HeaderValue , Headers , ToHeaderValues , IF_UNMODIFIED_SINCE } ;
2
2
use crate :: utils:: { fmt_http_date, parse_http_date} ;
3
3
4
4
use std:: fmt:: Debug ;
@@ -52,7 +52,7 @@ impl IfUnmodifiedSince {
52
52
53
53
/// Create an instance of `IfUnmodifiedSince` from a `Headers` instance.
54
54
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 ) {
56
56
Some ( headers) => headers,
57
57
None => return Ok ( None ) ,
58
58
} ;
@@ -67,12 +67,12 @@ impl IfUnmodifiedSince {
67
67
68
68
/// Insert a `HeaderName` + `HeaderValue` pair into a `Headers` instance.
69
69
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 ( ) ) ;
71
71
}
72
72
73
73
/// Get the `HeaderName`.
74
74
pub fn name ( & self ) -> HeaderName {
75
- IF_MODIFIED_SINCE
75
+ IF_UNMODIFIED_SINCE
76
76
}
77
77
78
78
/// Get the `HeaderValue`.
@@ -117,7 +117,7 @@ mod test {
117
117
#[ test]
118
118
fn bad_request_on_parse_error ( ) -> crate :: Result < ( ) > {
119
119
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.>" ) ;
121
121
let err = IfUnmodifiedSince :: from_headers ( headers) . unwrap_err ( ) ;
122
122
assert_eq ! ( err. status( ) , 400 ) ;
123
123
Ok ( ( ) )
0 commit comments