Skip to content

Commit

Permalink
Really fix protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
stvnrhodes committed Sep 1, 2024
1 parent fce8ab7 commit ed1ae62
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ struct Claims {

fn self_uri(req: &Request) -> String {
if let Some(host) = req.header("Host") {
let prefix =
if !req.is_secure() && !host.starts_with("localhost") && !host.starts_with("127.0.0.1")
{
"http://"
} else {
"https://"
};
let prefix = if !req.is_secure()
&& (host.starts_with("localhost") || host.starts_with("127.0.0.1"))
{
"http://"
} else {
"https://"
};
format!("{prefix}{host}")
} else {
"".into()
Expand Down

0 comments on commit ed1ae62

Please sign in to comment.