-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(headers): Use header!() for CORS headers.
This is the last bunch of headers that should use the new macro. Moved them out of their own folder so that the macro works. Changed them, so that they are more in line with the other headers. BREAKING CHANGE: `AccessControlAllowHeaders` and `AccessControlRequestHeaders` values are case insensitive now. `AccessControlAllowOrigin` variants are now `Any` and `Value` to match the other headers.
- Loading branch information
Showing
13 changed files
with
71 additions
and
184 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use unicase::UniCase; | ||
|
||
header! { | ||
#[doc="`Access-Control-Allow-Headers` header, part of"] | ||
#[doc="[CORS](www.w3.org/TR/cors/#access-control-allow-headers-response-header)"] | ||
#[doc=""] | ||
#[doc="The `Access-Control-Allow-Headers` header indicates, as part of the"] | ||
#[doc="response to a preflight request, which header field names can be used"] | ||
#[doc="during the actual request."] | ||
(AccessControlAllowHeaders, "Access-Control-Allow-Headers") => (UniCase<String>)* | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use method::Method; | ||
|
||
header! { | ||
#[doc="`Access-Control-Allow-Methods` header, part of"] | ||
#[doc="[CORS](www.w3.org/TR/cors/#access-control-allow-methods-response-header)"] | ||
#[doc=""] | ||
#[doc="The `Access-Control-Allow-Methods` header indicates, as part of the"] | ||
#[doc="response to a preflight request, which methods can be used during the"] | ||
#[doc="actual request."] | ||
(AccessControlAllowMethods, "Access-Control-Allow-Methods") => (Method)* | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
header! { | ||
#[doc="`Access-Control-Max-Age` header, part of"] | ||
#[doc="[CORS](www.w3.org/TR/cors/#access-control-max-age-response-header)"] | ||
#[doc=""] | ||
#[doc="The `Access-Control-Max-Age` header indicates how long the results of a"] | ||
#[doc="preflight request can be cached in a preflight result cache."] | ||
(AccessControlMaxAge, "Access-Control-Max-Age") => [u32] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use unicase::UniCase; | ||
|
||
header! { | ||
#[doc="`Access-Control-Request-Headers` header, part of"] | ||
#[doc="[CORS](www.w3.org/TR/cors/#access-control-request-headers-request-header)"] | ||
#[doc=""] | ||
#[doc="The `Access-Control-Request-Headers` header indicates which headers will"] | ||
#[doc="be used in the actual request as part of the preflight request."] | ||
#[doc="during the actual request."] | ||
(AccessControlRequestHeaders, "Access-Control-Request-Headers") => (UniCase<String>)* | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use method::Method; | ||
|
||
header! { | ||
#[doc="`Access-Control-Request-Method` header, part of"] | ||
#[doc="[CORS](www.w3.org/TR/cors/#access-control-request-method-request-header)"] | ||
#[doc=""] | ||
#[doc="The `Access-Control-Request-Method` header indicates which method will be"] | ||
#[doc="used in the actual request as part of the preflight request."] | ||
(AccessControlRequestMethod, "Access-Control-Request-Method") => [Method] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters