1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Handle log responses as text

Log endpoint always responds as `Content-Type: text/plain` but empty responses are converted to empty objects in JsonApi.

In case of resolved non-string log response, consider it empty (string).

Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
This commit is contained in:
Sami Tiilikainen 2023-05-25 11:05:11 +03:00
parent dd62e034b7
commit f10533d530

View File

@ -57,6 +57,12 @@ export class PodApi extends KubeApi<Pod> {
async getLogs(params: ResourceDescriptor, query?: PodLogsQuery): Promise<string> {
const path = `${this.getUrl(params)}/log`;
return this.request.get(path, { query });
const logs = await this.request.get(path, { query });
if (typeof logs !== "string") {
return "";
}
return logs;
}
}