diff --git a/src/server.ts b/src/server.ts index 3b39a88..7ea9fe5 100644 --- a/src/server.ts +++ b/src/server.ts @@ -44,9 +44,10 @@ app.get('/webcam/:printer', (req, res) => { let printer: PrinterStatus | undefined = printerStatuses.find( p => p.name === req.params.printer ); - if (printer && printer.webcamURL) + if (printer && printer.webcamURL) { + req.url = ''; // truncate the url for passing to the proxy proxy.web(req, res, { target: printer.webcamURL }); - else res.status(404).send('Not Found: Printer not known or has no webcam.'); + } else res.status(404).send('Not Found: Printer not known or has no webcam.'); }); let bundler = new Bundler(path.join(__dirname, 'index.html'));