Compare commits

...

1 Commits

Author SHA1 Message Date
claude[bot]
e7346f8837 feat: support octet-stream response type from base64 result
When windmill_content_type is set to "application/octet-stream", 
attempt to decode the result as base64 and send as raw bytes.
Falls back to original string response if decoding fails.

Resolves #5986

Co-authored-by: Ruben Fiszel <rubenfiszel@users.noreply.github.com>
2025-06-18 20:52:38 +00:00

View File

@@ -4187,6 +4187,14 @@ pub async fn run_wait_result(
Error::internal_err(format!("Invalid content type {content_type}: {err}"))
})?,
);
// If content type is octet-stream and result is base64, decode it and send as bytes
if content_type == "application/octet-stream" {
if let Ok(decoded_bytes) = base64::engine::general_purpose::STANDARD.decode(&serialized_result) {
return Ok((status_code_or_default, headers, decoded_bytes).into_response());
}
}
return Ok((status_code_or_default, headers, serialized_result).into_response());
}
if let Some(result_value) = result_value {