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:
parent
dd62e034b7
commit
f10533d530
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user