Skip to content

Commit

Permalink
fix: fixed proxy api key (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulobressan authored Nov 16, 2024
1 parent 2b89970 commit c1ec6d2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions proxy/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,12 @@ impl SubmitApiProxy {
.unwrap();

let captures = self.host_regex.captures(host).unwrap();
let mut key = session
let key = session
.get_header(DMTR_API_KEY)
.map(|v| v.to_str().unwrap())
.and_then(|v| v.to_str().ok())
.or_else(|| captures.get(1).map(|v| v.as_str()))
.unwrap_or_default();
if let Some(m) = captures.get(1) {
key = m.as_str();
}

key.to_string()
}

Expand Down

0 comments on commit c1ec6d2

Please sign in to comment.