I wrote a simple HTTPS server for my Dialogflow bot. In my code I just trust the req
object like this:
Express routing:
app.post('/', Route);
The function that Express calls:
function Route(req, res) {
if (req.body.status.errorType !== "success") {
return ;
}
// do something really awesome here
}
I think it's not a good idea. I should check the origin of the request. What do you think? Maybe I should use a basic-auth module or something, but I have no idea how to ensure the req
object has been processed by Dialogflow. How can I do that?