Skip to content

Commit a93f1d8

Browse files
committed
Fixed format
1 parent 9fbf3e1 commit a93f1d8

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pub const SYNTHETIC_HEADER_FRESH: &str = "X-Synthetic-Fresh";
22
pub const SYNTHETIC_HEADER_POTSI: &str = "X-Synthetic-Potsi";
3-
pub const SYNTHETIC_HEADER_PUB_USER_ID: &str = "X-Pub-User-ID";
3+
pub const SYNTHETIC_HEADER_PUB_USER_ID: &str = "X-Pub-User-ID";

src/prebid.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ impl PrebidRequest {
8989
///
9090
/// # Returns
9191
/// * `Result<Response, Error>` - Prebid Server response or error
92-
pub async fn send_bid_request(&self, settings: &Settings, incoming_req: &Request) -> Result<Response, Error> {
92+
pub async fn send_bid_request(
93+
&self,
94+
settings: &Settings,
95+
incoming_req: &Request,
96+
) -> Result<Response, Error> {
9397
let mut req = Request::new(Method::POST, settings.prebid.server_url.to_owned());
9498

9599
// Get and store the POTSI ID value from the incoming request

src/synthetic.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use fastly::http::header;
22
use fastly::Request;
3-
use hmac::{Hmac, Mac};
4-
use sha2::Sha256;
53
use handlebars::Handlebars;
4+
use hmac::{Hmac, Mac};
65
use serde_json::json;
6+
use sha2::Sha256;
77

88
use crate::constants::{SYNTHETIC_HEADER_POTSI, SYNTHETIC_HEADER_PUB_USER_ID};
99
use crate::cookies::handle_request_cookies;
@@ -42,10 +42,11 @@ pub fn generate_synthetic_id(settings: &Settings, req: &Request) -> String {
4242
"accept_language": accept_language.unwrap_or("unknown")
4343
});
4444

45-
let input_string = handlebars.render_template(&settings.synthetic.template, data).unwrap();
45+
let input_string = handlebars
46+
.render_template(&settings.synthetic.template, data)
47+
.unwrap();
4648
println!("Input string for fresh ID: {} {}", input_string, data);
4749

48-
4950
let mut mac = HmacSha256::new_from_slice(settings.synthetic.secret_key.as_bytes())
5051
.expect("HMAC can take key of any size");
5152
mac.update(input_string.as_bytes());

0 commit comments

Comments
 (0)