mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-24 20:34:05 +02:00
Return the body of a send that saved nothing
Replaces the response-directory fallback with what the frontend already does for ephemeral sends: the engine hands the body back, because it is the only copy. Guessing at a file named for an id was the store reaching around its own abstraction, and it is exactly what must not survive the move to blob storage. The send reply carries the bytes when the engine returned them, and the runtime holds them for the rest of the call that sent them, so ctx.httpResponse.body() answers for a saved and an unsaved response the same way. Unsaved ones now report a real contentType too, taken from the response the send already handed back.
This commit is contained in:
@@ -294,6 +294,15 @@ pub struct SendHttpRequestRequest {
|
||||
#[ts(export, export_to = "gen_events.ts")]
|
||||
pub struct SendHttpRequestResponse {
|
||||
pub http_response: HttpResponse,
|
||||
|
||||
/// The body, base64, when the send saved nothing.
|
||||
///
|
||||
/// A request with no id behind it produces a response the model store never
|
||||
/// sees, so it cannot be read back by id later the way a saved one can.
|
||||
/// This is the only copy of it. `None` means the body was stored and should
|
||||
/// be read with `read_http_response_body_chunk_request`.
|
||||
#[ts(optional = nullable)]
|
||||
pub body: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize, TS)]
|
||||
|
||||
Reference in New Issue
Block a user