File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 33## Unreleased
44
55- Add ` http::header::ContentLocation ` typed header.
6+ - Add ` http::header::Location ` typed header.
67
78## 4.9.0
89
Original file line number Diff line number Diff line change 1+ use super :: { Uri , LOCATION } ;
2+
3+ crate :: http:: header:: common_header! {
4+ /// `Location` header, defined
5+ /// in [RFC 7231 §7.1.2](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.2)
6+ ///
7+ /// The "Location" header field is used in some responses to refer to a
8+ /// specific resource in relation to the response. The type of
9+ /// relationship is defined by the combination of request method and
10+ /// status code semantics.
11+ ///
12+ /// # ABNF
13+ /// ```plain
14+ /// Location = URI-reference
15+ /// ```
16+ ///
17+ /// # Example Values
18+ /// * `http://www.example.org/hypertext/Overview.html`
19+ ///
20+ /// # Examples
21+ ///
22+ /// ```
23+ /// use actix_web::HttpResponse;
24+ /// use actix_http::Uri;
25+ /// use actix_web::http::header::Location;
26+ ///
27+ /// let mut builder = HttpResponse::Ok();
28+ /// builder.insert_header(
29+ /// Location("http://www.example.org".parse::<Uri>().unwrap())
30+ /// );
31+ /// ```
32+ ( Location , LOCATION ) => [ Uri ]
33+
34+ test_parse_and_format {
35+ crate :: http:: header:: common_header_test!( test1, [ b"http://www.example.org/hypertext/Overview.html" ] ) ;
36+ }
37+ }
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ mod if_none_match;
4040mod if_range;
4141mod if_unmodified_since;
4242mod last_modified;
43+ mod location;
4344mod macros;
4445mod preference;
4546mod range;
@@ -71,6 +72,7 @@ pub use self::{
7172 if_range:: IfRange ,
7273 if_unmodified_since:: IfUnmodifiedSince ,
7374 last_modified:: LastModified ,
75+ location:: Location ,
7476 preference:: Preference ,
7577 range:: { ByteRangeSpec , Range } ,
7678} ;
You can’t perform that action at this time.
0 commit comments