Skip to content

Commit 38ccf66

Browse files
authored
Merge pull request #342 from AdExNetwork/issue-339-no-heartbeats-in-response
no heartbeats in response when query param is not provided
2 parents 29585a4 + 05d161b commit 38ccf66

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

adview-manager/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ impl Manager {
411411
.collect::<Vec<_>>()
412412
.join("&");
413413

414-
415414
// Url adds a trailing `/`
416415
let url = format!(
417416
"{}units-for-slot/{}?pubPrefix={}&{}",

primitives/src/sentry.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ pub struct ChannelListResponse {
135135
#[serde(rename_all = "camelCase")]
136136
pub struct LastApprovedResponse {
137137
pub last_approved: Option<LastApproved>,
138+
/// None -> withHeartbeat=true wasn't passed
139+
/// Some(vec![]) (empty vec) or Some(heartbeats) - withHeartbeats=true was passed
140+
#[serde(default, skip_serializing_if = "Option::is_none")]
138141
pub heartbeats: Option<Vec<HeartbeatValidatorMessage>>,
139142
}
140143

primitives/src/targeting/eval.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ impl Into<SerdeValue> for Value {
130130
Value::Bool(bool) => SerdeValue::Bool(bool),
131131
Value::Number(number) => SerdeValue::Number(number),
132132
Value::String(string) => SerdeValue::String(string),
133-
Value::Array(array) => SerdeValue::Array(array.into_iter().map(|value| value.into()).collect()),
134-
Value::BigNum(bignum) => SerdeValue::String(bignum.to_string())
133+
Value::Array(array) => {
134+
SerdeValue::Array(array.into_iter().map(|value| value.into()).collect())
135+
}
136+
Value::BigNum(bignum) => SerdeValue::String(bignum.to_string()),
135137
}
136138
}
137139
}

0 commit comments

Comments
 (0)