Skip to content

Commit

Permalink
Merge pull request #5209 from snwoods/private/stevenwo/CA-383987
Browse files Browse the repository at this point in the history
CA-383987: Ensure tracing request Host header is correct by not using…
  • Loading branch information
robhoes authored Oct 20, 2023
2 parents 481df83 + 14ddc45 commit 8ba52c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ocaml/libs/tracing/tracing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -688,12 +688,15 @@ module Export = struct
let export ~url json =
try
let body = json in
(*If host or port is None it will throw a more meaningful error later, so ignore here*)
let hostname = match Uri.host url with Some h -> h | None -> "" in
let port = match Uri.port url with Some p -> p | None -> 80 in
let headers =
Cohttp.Header.of_list
[
("Content-Type", "application/json")
; ("Content-Length", string_of_int (String.length body))
; ("Host", "jaeger.xenrt.citrite.net:9411")
; ("Host", hostname ^ ":" ^ string_of_int port)
]
in
Open_uri.with_open_uri url (fun fd ->
Expand Down

0 comments on commit 8ba52c4

Please sign in to comment.