Skip to content

Commit ec1ec86

Browse files
committed
controllers/util: Implement verify_origin() for all RequestPartsExt implementers
1 parent fd96bd6 commit ec1ec86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/controllers/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use http::{Extensions, HeaderMap, HeaderValue, Method, Request, Uri, Version};
88
/// We don't want to accept authenticated requests that originated from other sites, so this
99
/// function returns an error if the Origin header doesn't match what we expect "this site" to
1010
/// be: https://crates.io in production, or http://localhost:port/ in development.
11-
pub fn verify_origin<B>(req: &Request<B>) -> AppResult<()> {
11+
pub fn verify_origin<T: RequestPartsExt>(req: &T) -> AppResult<()> {
1212
let headers = req.headers();
1313
let allowed_origins = &req.app().config.allowed_origins;
1414

0 commit comments

Comments
 (0)