Now passes the user agent that is making the post request (requesting content) so it can be saved in the db.

This commit is contained in:
2017-10-03 16:11:15 +02:00
parent f50e0b2a59
commit a819a4bbf3

View File

@@ -13,8 +13,9 @@ function submitRequestController(req, res) {
const id = req.params.mediaId;
const type = req.query.type;
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
var user_agent = req.headers['User-Agent']
requestRepository.sendRequest(id, type, ip)
requestRepository.sendRequest(id, type, ip, user_agent)
.then(() => {
res.send({ success: true, message: 'Media item sucessfully requested!' });
})