修复docker top查询路径空格未编码导致接口500
This commit is contained in:
@@ -292,7 +292,7 @@ const http = require('http');
|
||||
function hermesRunnerProcs() {
|
||||
return new Promise((resolve) => {
|
||||
const req = http.request(
|
||||
{ socketPath: '/var/run/docker.sock', path: '/containers/hermes/top?ps_args=-eo pid,args', method: 'GET', timeout: 3000 },
|
||||
{ socketPath: '/var/run/docker.sock', path: '/containers/hermes/top?ps_args=-eo%20pid,args', method: 'GET', timeout: 3000 },
|
||||
(r) => { let d = ''; r.on('data', (c) => d += c); r.on('end', () => { try { resolve(JSON.parse(d).Processes || []); } catch (_) { resolve([]); } }); }
|
||||
);
|
||||
req.on('error', () => resolve([]));
|
||||
|
||||
Reference in New Issue
Block a user