Skip to content

Commit

Permalink
fix: webhook optional field (#296)
Browse files Browse the repository at this point in the history
Co-authored-by: Ankit Mahato <[email protected]>
  • Loading branch information
mahatoankitkumar and Ankit Mahato authored Dec 3, 2024
1 parent 516a2c1 commit fe0171f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/service_utils/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ where
let mut header_array = webhook_config
.service_headers
.clone()
.unwrap_or_default()
.into_iter()
.filter_map(|key| match key {
HeadersEnum::ConfigVersion => {
Expand All @@ -445,6 +446,7 @@ where
webhook_config
.custom_headers
.clone()
.unwrap_or_default()
.into_iter()
.for_each(|(key, value)| header_array.push((key, value)));

Expand Down
4 changes: 2 additions & 2 deletions crates/superposition_types/src/webhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ pub struct Authorization {
pub struct Webhook {
pub url: String,
pub method: HttpMethod,
pub custom_headers: HashMap<String, String>,
pub service_headers: Vec<HeadersEnum>,
pub custom_headers: Option<HashMap<String, String>>,
pub service_headers: Option<Vec<HeadersEnum>>,
pub authorization: Option<Authorization>,
}

Expand Down

0 comments on commit fe0171f

Please sign in to comment.