File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 44
55- Add ` http::header::ContentLocation ` typed header.
66- Add ` http::header::Location ` typed header.
7+ - Add ` http::header::Referer ` typed header.
78
89## 4.9.0
910
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ mod location;
4444mod macros;
4545mod preference;
4646mod range;
47+ mod referer;
4748
4849#[ cfg( test) ]
4950pub ( crate ) use self :: macros:: common_header_test;
@@ -75,6 +76,7 @@ pub use self::{
7576 location:: Location ,
7677 preference:: Preference ,
7778 range:: { ByteRangeSpec , Range } ,
79+ referer:: Referer ,
7880} ;
7981
8082/// Format writer ([`fmt::Write`]) for a [`BytesMut`].
Original file line number Diff line number Diff line change 1+ use super :: { Uri , REFERER } ;
2+
3+ crate :: http:: header:: common_header! {
4+ /// `Referer` header, defined
5+ /// in [RFC 7231 §5.5.2](https://datatracker.ietf.org/doc/html/rfc7231#section-5.5.2)
6+ ///
7+ /// The "Referer" (sic) header field allows the user agent to specify a
8+ /// URI reference for the resource from which the target URI was obtained
9+ /// (i.e., the "referrer", though the field name is misspelled).
10+ ///
11+ /// # ABNF
12+ /// ```plain
13+ /// Referer = absolute-URI / partial-URI
14+ /// ```
15+ ///
16+ /// # Example Values
17+ /// * `http://www.example.org/hypertext/Overview.html`
18+ ///
19+ /// # Examples
20+ ///
21+ /// ```
22+ /// use actix_web::HttpResponse;
23+ /// use actix_http::Uri;
24+ /// use actix_web::http::header::Referer;
25+ ///
26+ /// let mut builder = HttpResponse::Ok();
27+ /// builder.insert_header(
28+ /// Referer("http://www.example.org".parse::<Uri>().unwrap())
29+ /// );
30+ /// ```
31+ ( Referer , REFERER ) => [ Uri ]
32+
33+ test_parse_and_format {
34+ crate :: http:: header:: common_header_test!( test1, [ b"http://www.example.org/hypertext/Overview.html" ] ) ;
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments