Skip to content

Commit

Permalink
Remove non-standard colon from auth header separator
Browse files Browse the repository at this point in the history
Signed-off-by: Lilly Rose Berner <lilly@lostluma.net>
  • Loading branch information
LostLuma committed Nov 20, 2024
1 parent 8bb9284 commit b7c35ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion echo/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"schema": {
"type": "string",
"format": "password",
"description": "A password to access a secret Paste. Must have `password:` prefix."
"description": "A password to access a secret Paste. Must have `Password` prefix."
},
"required": false,
"in": "header",
Expand Down
2 changes: 1 addition & 1 deletion echo/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<'r> FromRequest<'r> for PasswordHeader<'r> {
None => return Outcome::Error((Status::Unauthorized, "Missing Authorization header.")),
};

static PATTERN: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?i:password): .+").unwrap());
static PATTERN: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?i:password) .+").unwrap());

if !PATTERN.is_match(value) {
return Outcome::Error((Status::Unauthorized, "Invalid Authorization header."));
Expand Down

0 comments on commit b7c35ab

Please sign in to comment.