Skip to content

Commit

Permalink
Feature/add content length to tsa request (#587)
Browse files Browse the repository at this point in the history
using send_bytes instead of send to ensure Content-Length header is sent

Co-authored-by: mauricefisher64 <92736594+mauricefisher64@users.noreply.github.com>
  • Loading branch information
kingcdavid and mauricefisher64 authored Sep 24, 2024
1 parent ea0ae2c commit 91aac1e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sdk/src/time_stamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ fn time_stamp_request_http(
.encode_ref()
.write_encoded(bcder::Mode::Der, &mut body)?;

let body_reader = std::io::Cursor::new(body);

let mut req = ureq::post(url);

if let Some(headers) = headers {
Expand All @@ -145,7 +143,7 @@ fn time_stamp_request_http(

let response = req
.set("Content-Type", HTTP_CONTENT_TYPE_REQUEST)
.send(body_reader)
.send_bytes(&body)
.map_err(|_err| Error::CoseTimeStampGeneration)?;

if response.status() == 200 && response.content_type() == HTTP_CONTENT_TYPE_RESPONSE {
Expand Down

0 comments on commit 91aac1e

Please # to comment.