Skip to content

Commit

Permalink
feat: add host in the data-collection api call
Browse files Browse the repository at this point in the history
  • Loading branch information
SachaMorard committed Nov 6, 2024
1 parent 27611f7 commit 1d23997
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/proxy/compute/data_collection/data_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,15 @@ pub async fn process_from_html(
} else {
"false"
};
let host = request.get_host().to_string();
tokio::spawn(async move {
let _ = reqwest::Client::new()
.post(api_url)
.header("Content-Type", "application/json")
.header("Authorization", format!("Basic {}", b64))
.header("X-Edgee-Debug", debug)
.header("X-Edgee-From", "edge")
.header("X-Edgee-Host", host)
.body(events_json)
.send()
.await;
Expand Down Expand Up @@ -235,6 +237,7 @@ pub async fn process_from_json(
} else {
"client"
};
let host = request.get_host().to_string();
// now, we can send the payload to the edgee data-collection-api without waiting for the response
tokio::spawn(async move {
let _ = reqwest::Client::new()
Expand All @@ -243,6 +246,7 @@ pub async fn process_from_json(
.header("Authorization", format!("Basic {}", b64))
.header("X-Edgee-Debug", debug)
.header("X-Edgee-From", from)
.header("X-Edgee-Host", host)
.body(events_json)
.send()
.await;
Expand Down

0 comments on commit 1d23997

Please sign in to comment.