File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -2,18 +2,10 @@ use crate::web::escaped_uri::EscapedURI;
22use anyhow:: Result ;
33use askama:: filters:: HtmlSafe ;
44use axum:: http:: uri:: Uri ;
5- use axum_extra:: headers:: { ETag , Header , HeaderName , HeaderValue } ;
5+ use axum_extra:: headers:: { Header , HeaderName , HeaderValue } ;
66use serde:: Serialize ;
77use std:: { fmt, ops:: Deref } ;
88
9- /// compute our etag header value from some content
10- ///
11- /// Has to match the implementation in our build-script.
12- pub fn compute_etag < T : AsRef < [ u8 ] > > ( content : T ) -> ETag {
13- let digest = md5:: compute ( & content) ;
14- format ! ( "\" {:x}\" " , digest) . parse ( ) . unwrap ( )
15- }
16-
179/// simplified typed header for a `Link rel=canonical` header in the response.
1810///
1911/// When given only a path, it builds a full docs.rs URL.
Original file line number Diff line number Diff line change 11mod canonical_url;
22mod surrogate_key;
33
4+ use axum_extra:: headers:: ETag ;
45pub use canonical_url:: CanonicalUrl ;
56use http:: HeaderName ;
67pub use surrogate_key:: { SURROGATE_KEY , SurrogateKey , SurrogateKeys } ;
78
89/// Fastly's Surrogate-Control header
910/// https://www.fastly.com/documentation/reference/http/http-headers/Surrogate-Control/
1011pub static SURROGATE_CONTROL : HeaderName = HeaderName :: from_static ( "surrogate-control" ) ;
12+
13+ /// compute our etag header value from some content
14+ ///
15+ /// Has to match the implementation in our build-script.
16+ pub fn compute_etag < T : AsRef < [ u8 ] > > ( content : T ) -> ETag {
17+ let digest = md5:: compute ( & content) ;
18+ format ! ( "\" {:x}\" " , digest) . parse ( ) . unwrap ( )
19+ }
You can’t perform that action at this time.
0 commit comments