Skip to content

Commit

Permalink
Fix up empty query param handling
Browse files Browse the repository at this point in the history
Signed-off-by: lloydmeta <[email protected]>
  • Loading branch information
lloydmeta committed Oct 29, 2024
1 parent e649673 commit d75d0ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/src/api/routing/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,12 @@ fn ensure_signature_is_valid(
.map(|pq| {
// lambda axum seems to insert empty query params when handling reqs
// as a lambda
pq.as_str().strip_suffix("?").unwrap_or(pq.as_str())
let pq_as_str = pq.as_str();
if uri.query().filter(|q| !q.trim().is_empty()).is_some() {
pq_as_str
} else {
pq_as_str.strip_suffix("?").unwrap_or(pq_as_str)
}
})
.unwrap_or("")
};
Expand Down

0 comments on commit d75d0ee

Please sign in to comment.