Skip to content

Commit

Permalink
fix: encoded vals (#9)
Browse files Browse the repository at this point in the history
* fix: encoded jsons

* chore: bump
  • Loading branch information
lauti7 authored May 31, 2023
1 parent 5865a35 commit 37e0829
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dcl-crypto-middleware-rs"
version = "0.2.0"
version = "0.2.1"
description = "Utils to authenticate Decentraland users on Rust services"
repository = "https://github.com/decentraland/dcl-crypto-middleware-rs"
readme = "./README.md"
Expand Down
9 changes: 8 additions & 1 deletion src/ws_signed_headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ pub async fn authenticate_dcl_user_with_signed_headers<
{
let signed_headers = signed_headers
.iter()
.map(|(key, value)| (key.to_owned(), value.to_string()))
.map(|(key, value)| {
let val = match value {
Value::Object(_) | Value::Number(_) => value.to_string(),
Value::String(s) => s.to_owned(),
_ => "".to_string(),
};
(key.to_owned(), val)
})
.collect::<HashMap<String, String>>();

signed_fetch::verify(
Expand Down

0 comments on commit 37e0829

Please sign in to comment.