Skip to content
This repository was archived by the owner on Nov 3, 2020. It is now read-only.

Commit 0b2540d

Browse files
committed
Allow ALEXA_APPLICATION_ID to be null
1 parent 4096a09 commit 0b2540d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

index.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,15 @@ function ping_on_blocking_download(id, callback) {
335335
}
336336

337337
app.pre = function(req, res, type) {
338-
if (req.data.session !== undefined) {
339-
if (req.data.session.application.applicationId !== process.env.ALEXA_APPLICATION_ID) {
340-
res.fail("Invalid application");
341-
}
342-
} else {
343-
if (req.applicationId !== process.env.ALEXA_APPLICATION_ID) {
344-
res.fail("Invalid application");
338+
if (process.env.ALEXA_APPLICATION_ID != null) {
339+
if (req.data.session !== undefined) {
340+
if (req.data.session.application.applicationId !== process.env.ALEXA_APPLICATION_ID) {
341+
res.fail("Invalid application");
342+
}
343+
} else {
344+
if (req.applicationId !== process.env.ALEXA_APPLICATION_ID) {
345+
res.fail("Invalid application");
346+
}
345347
}
346348
}
347349
};

0 commit comments

Comments
 (0)