diff --git a/mods/proxy/init.js b/mods/proxy/init.js index b8a0639c..874f00d2 100644 --- a/mods/proxy/init.js +++ b/mods/proxy/init.js @@ -46,7 +46,7 @@ function proxy_post(req, res, next) { res.end(); }); } 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 { diff --git a/src/kiri/app/export.js b/src/kiri/app/export.js index b1e5556f..a07cefff 100644 --- a/src/kiri/app/export.js +++ b/src/kiri/app/export.js @@ -284,9 +284,12 @@ function exportGCodeDialog(gcode, sections, info, names) { } api.show.progress(0); 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`, { method: 'POST', - headers: { 'Content-Type': 'application/json' }, + headers, body: JSON.stringify({ filename }) }) .then(r => r.json())