change from header to query as header is not usable with a JS client

This commit is contained in:
Kalle 2019-02-22 09:40:40 +01:00
parent 6768379602
commit 4db6b2ea06

View File

@ -94,10 +94,10 @@ module.exports.connectionHandler = async (event, context) => {
if(event.requestContext.routeKey === '$connect'){
console.log("NEW CONNECTION INCOMMING");
if (event.headers.token !== 'abc') {
if (event.queryStringParameters.token !== 'abc') {
console.log('Connection blocked');
return {
statusCode: 500
statusCode: 500 // currently it is not possible to respond with a 4XX
};
}
}