mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
feat(core): Add masking support for form-data types request (#9496)
Co-authored-by: Sayak Bhattacharya <sayak.b@Sayak-Bhattacharya-G092THXJ34.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d98adb2e03
commit
1af7f42762
@ -1,4 +1,5 @@
|
||||
use masking::{Maskable, Secret};
|
||||
use reqwest::multipart::Form;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use utoipa::ToSchema;
|
||||
|
||||
@ -66,7 +67,7 @@ impl std::fmt::Debug for RequestContent {
|
||||
pub enum RequestContent {
|
||||
Json(Box<dyn masking::ErasedMaskSerialize + Send>),
|
||||
FormUrlEncoded(Box<dyn masking::ErasedMaskSerialize + Send>),
|
||||
FormData(reqwest::multipart::Form),
|
||||
FormData((Form, Box<dyn masking::ErasedMaskSerialize + Send>)),
|
||||
Xml(Box<dyn masking::ErasedMaskSerialize + Send>),
|
||||
RawBytes(Vec<u8>),
|
||||
}
|
||||
@ -77,7 +78,7 @@ impl RequestContent {
|
||||
Self::Json(i) => serde_json::to_string(&i).unwrap_or_default().into(),
|
||||
Self::FormUrlEncoded(i) => serde_urlencoded::to_string(i).unwrap_or_default().into(),
|
||||
Self::Xml(i) => quick_xml::se::to_string(&i).unwrap_or_default().into(),
|
||||
Self::FormData(_) => String::new().into(),
|
||||
Self::FormData((_, i)) => serde_json::to_string(i).unwrap_or_default().into(),
|
||||
Self::RawBytes(_) => String::new().into(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user