From 3c5c45d4e6f1b6f7f8a8e29787fb12074eeb53e1 Mon Sep 17 00:00:00 2001 From: Ronald Holshausen Date: Wed, 17 Aug 2022 14:46:03 +1000 Subject: [PATCH] fix(FFI): pactffi_with_binary_file was incorrectly setting the response content type to application/octet-stream #171 --- rust/pact_ffi/src/mock_server/handles.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/pact_ffi/src/mock_server/handles.rs b/rust/pact_ffi/src/mock_server/handles.rs index c9be77ccb..efcf8424f 100644 --- a/rust/pact_ffi/src/mock_server/handles.rs +++ b/rust/pact_ffi/src/mock_server/handles.rs @@ -1341,10 +1341,10 @@ pub extern fn pactffi_with_binary_file( if !reqres.response.has_header(&content_type_header) { match reqres.response.headers { Some(ref mut headers) => { - headers.insert(content_type_header.clone(), vec!["application/octet-stream".to_string()]); + headers.insert(content_type_header.clone(), vec![content_type.to_string()]); }, None => { - reqres.response.headers = Some(hashmap! { content_type_header.clone() => vec!["application/octet-stream".to_string()]}); + reqres.response.headers = Some(hashmap! { content_type_header.clone() => vec![content_type.to_string()]}); } } }