Hi guysI'm trying to debug an application, and decided to dummy up the camera api I'm testing against in Node.js and ExpressI've successfully implemented all the authentication and other gubbins, but for whatever reason I'm not able to escape special characters in the routes (which is the half that I decided to start working on last night)My get request will be: /cgi-bin/aw_ptz?cmd=%23O&res=1 to retrieve the power status, and I've escaped the request as: app.get('/cgi-bin/aw_ptz\?cmd\=\%23O\&res\=1', (req, res) => res.status(200).send('p1')) However the error I'm getting back is:Cannot GET /cgi-bin/aw_ptzEven taking it back to the minimum, it fails with the same error app.get('/cgi-bin/aw_ptz\?cmd', (req, res) => res.status(200).send('ok')) I've been using the route tester ( http://forbeslindesay.github.io/express-route-tester/ ) however this doesn't get me any further down the road.It's annoying as I had just kind of assumed that standard escaping would just work, and I can just use string manipulation to generate the set of routes that I need to validate my changes.
Submitted January 17, 2020 at 11:00AM by scottyman2k
No comments:
Post a Comment