proxy print start command when needed

This commit is contained in:
Stewart Allen 2026-04-12 13:56:07 -04:00 • committed by Stewart Allen
commit 13420592dd
2 changed files with 5 additions and 2 deletions

View file

@ -46,7 +46,7 @@ function proxy_post(req, res, next) {
res.end(); res.end();
}); });
} else { } else {
console.log('drop proxy due to lack of host'); console.log('drop proxy due to lack of host', { chunks: chunks.map(c => c.toString()) });
} }
}); });
} else { } else {

View file

@ -284,9 +284,12 @@ function exportGCodeDialog(gcode, sections, info, names) {
} }
api.show.progress(0); api.show.progress(0);
if (start && type === 'moonraker') { if (start && type === 'moonraker') {
const headers = { 'Content-Type': 'application/json' };
if (proxy) hdr['X-Host'] = proxy;
if (apik) hdr['X-Api-Key'] = apik;
fetch(`${host}/printer/print/start`, { fetch(`${host}/printer/print/start`, {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers,
body: JSON.stringify({ filename }) body: JSON.stringify({ filename })
}) })
.then(r => r.json()) .then(r => r.json())