check multiple posible stripe headers
This commit is contained in:
parent
ee626bfa61
commit
7044edc63c
@ -101,11 +101,19 @@ pub async fn user_balance_stripe_post(
|
||||
// ))?;
|
||||
|
||||
// TODO Get this from the header
|
||||
let signature = headers
|
||||
.get("STRIPE_SIGNATURE")
|
||||
.ok_or(Web3ProxyError::BadRequest(
|
||||
let signature = if let Some(x) = headers.get("stripe-signature") {
|
||||
x
|
||||
} else if let Some(x) = headers.get("STRIPE_SIGNATURE") {
|
||||
x
|
||||
} else if let Some(x) = headers.get("HTTP_STRIPE_SIGNATURE") {
|
||||
x
|
||||
} else {
|
||||
return Err(Web3ProxyError::BadRequest(
|
||||
"You have not provided a 'STRIPE_SIGNATURE' for the Stripe payload".into(),
|
||||
))?
|
||||
));
|
||||
};
|
||||
|
||||
let signature = signature
|
||||
.to_str()
|
||||
.web3_context("Could not parse stripe signature as byte-string")?;
|
||||
|
||||
|
@ -10,7 +10,7 @@ use tokio::{
|
||||
};
|
||||
use web3_proxy::rpcs::blockchain::ArcBlock;
|
||||
|
||||
#[cfg_attr(not(feature = "tests-needing-docker"), ignore)]
|
||||
// #[cfg_attr(not(feature = "tests-needing-docker"), ignore)]
|
||||
#[ignore = "under construction"]
|
||||
#[test_log::test(tokio::test)]
|
||||
async fn it_migrates_the_db() {
|
||||
|
Loading…
Reference in New Issue
Block a user