check if req.query exist before getting req.query.api_key/map_key

This commit is contained in:
Eneko Lakasta 2018-02-15 15:20:05 +01:00
parent fc420c2c0f
commit 3e916c6054

View File

@ -34,11 +34,11 @@ function getApikeyTokenFromHeaderAuthorization(req) {
}
function getApikeyTokenFromRequestQueryString(req) {
if (req.query.api_key) {
if (req.query && req.query.api_key) {
return req.query.api_key;
}
if (req.query.map_key) {
if (req.query && req.query.map_key) {
return req.query.map_key;
}