mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-25 04:44:12 +02:00
Address response bodies by response id instead of a filesystem path
The body commands took a path from the client, so a token holder could read any file the process could. They now take a response id and resolve the location themselves, and the UI never sees a path at all: the desktop host asks the backend where the file is, and the bridge fetches /responses/:id/body. Ephemeral responses (GraphQL introspection) never reach the database, so resolution falls back to the path send writes them to.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::render::render_http_request;
|
||||
use crate::responses::response_body_path;
|
||||
use async_trait::async_trait;
|
||||
use log::warn;
|
||||
use std::path::{Path, PathBuf};
|
||||
@@ -660,7 +661,7 @@ pub async fn send_http_request<T: TemplateCallback>(
|
||||
source,
|
||||
}
|
||||
})?;
|
||||
let body_path = params.response_dir.join(&response.id);
|
||||
let body_path = response_body_path(params.response_dir, &response.id);
|
||||
let response_body_path = body_path.to_string_lossy().to_string();
|
||||
let connected_response = HttpResponse {
|
||||
state: HttpResponseState::Connected,
|
||||
|
||||
Reference in New Issue
Block a user