diff --git a/CHANGELOG.md b/CHANGELOG.md index 86adc27..f8ec830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [1.9.0](/~https://github.com/maxbeckers/amazon-alexa-php/tree/1.10.0) (2021-11-26) +[Full Changelog](/~https://github.com/maxbeckers/amazon-alexa-php/compare/1.9.0...1.10.0) + ## [1.9.0](/~https://github.com/maxbeckers/amazon-alexa-php/tree/1.9.0) (2020-08-28) [Full Changelog](/~https://github.com/maxbeckers/amazon-alexa-php/compare/1.8.0...1.9.0) diff --git a/examples/ask-for-permissions-card-response.php b/examples/ask-for-permissions-card-response.php index 9957bd0..260e2a7 100644 --- a/examples/ask-for-permissions-card-response.php +++ b/examples/ask-for-permissions-card-response.php @@ -22,6 +22,11 @@ if ($requestBody) { $alexaRequest = Request::fromAmazonRequest($requestBody, $_SERVER['HTTP_SIGNATURECERTCHAINURL'], $_SERVER['HTTP_SIGNATURE']); + if (!$alexaRequest) { + http_response_code(400); + exit(); + } + // Request validation $validator = new RequestValidator(); $validator->validate($alexaRequest); @@ -39,6 +44,8 @@ // render response header('Content-Type: application/json'); echo json_encode($response); +} else { + http_response_code(400); } exit(); diff --git a/examples/card-response.php b/examples/card-response.php index 9ccbefd..b0f3ac2 100644 --- a/examples/card-response.php +++ b/examples/card-response.php @@ -22,6 +22,11 @@ if ($requestBody) { $alexaRequest = Request::fromAmazonRequest($requestBody, $_SERVER['HTTP_SIGNATURECERTCHAINURL'], $_SERVER['HTTP_SIGNATURE']); + if (!$alexaRequest) { + http_response_code(400); + exit(); + } + // Request validation $validator = new RequestValidator(); $validator->validate($alexaRequest); @@ -39,6 +44,8 @@ // render response header('Content-Type: application/json'); echo json_encode($response); +} else { + http_response_code(400); } exit(); diff --git a/examples/simple-intent-request.php b/examples/simple-intent-request.php index e9b3224..d89f4d8 100644 --- a/examples/simple-intent-request.php +++ b/examples/simple-intent-request.php @@ -22,6 +22,11 @@ if ($requestBody) { $alexaRequest = Request::fromAmazonRequest($requestBody, $_SERVER['HTTP_SIGNATURECERTCHAINURL'], $_SERVER['HTTP_SIGNATURE']); + if (!$alexaRequest) { + http_response_code(400); + exit(); + } + // Request validation $validator = new RequestValidator(); $validator->validate($alexaRequest); @@ -39,6 +44,8 @@ // render response header('Content-Type: application/json'); echo json_encode($response); +} else { + http_response_code(400); } exit();