You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please fill out the sections below to help us address your issue.
Version of AWS SDK for PHP?
"aws/aws-sdk-php": "~2.6.0",
Version of Amazon SNS Message Validator for PHP?
"aws/aws-php-sns-message-validator": "^1.6"
Version of PHP (php -v)?
PHP 7.2.34
What issue did you see?
when executing I get the following message:
PHP Fatal error: Uncaught RuntimeException: SNS message type header not provided. in /var/www/vhosts/studio/vendor/aws/aws-php-sns-message-validator/src/Message.php:40
Stack trace:
thrown in /var/www/vhosts/studio/vendor/aws/aws-php-sns-message-validator/src/Message.php on line 40
Steps to reproduce
If you have a runnable example, please include it as a snippet or link to a repository/gist for larger code examples.
I install sdk through composer, and I send it to call in an index.php file, is:
require'vendor/autoload.php';
useAws\Sns\Message;
useAws\Sns\MessageValidator;
useAws\Sns\Exception\InvalidSnsMessageException;
// Instantiate the Message and Validator$message = Message::fromRawPostData();
$validator = newMessageValidator();
// Validate the message and log errors if invalid.try {
$validator->validate($message);
} catch (InvalidSnsMessageException$e) {
// Pretend we're not here if the message is invalid.http_response_code(404);
error_log('SNS Message Validation Error: ' . $e->getMessage());
die();
}
// Check the type of the message and handle the subscription.if ($message['Type'] === 'SubscriptionConfirmation') {
// Confirm the subscription by sending a GET request to the SubscribeURLfile_get_contents($message['SubscribeURL']);
}
Additional context
Any additional information relevant to the issue. Examples include any framework you may be using (e.g. Laravel, Wordpress) in conjunction with the AWS SDK for PHP, or PHP/environment config settings if the issue is related to memory or performance.
The text was updated successfully, but these errors were encountered:
Please fill out the sections below to help us address your issue.
Version of AWS SDK for PHP?
"aws/aws-sdk-php": "~2.6.0",
Version of Amazon SNS Message Validator for PHP?
"aws/aws-php-sns-message-validator": "^1.6"
Version of PHP (
php -v
)?PHP 7.2.34
What issue did you see?
when executing I get the following message:
PHP Fatal error: Uncaught RuntimeException: SNS message type header not provided. in /var/www/vhosts/studio/vendor/aws/aws-php-sns-message-validator/src/Message.php:40
Stack trace:
0 /var/www/vhosts/studio/index.php(8): Aws \ Sns \ Message :: fromRawPostData ()
1 {main}
thrown in /var/www/vhosts/studio/vendor/aws/aws-php-sns-message-validator/src/Message.php on line 40
Steps to reproduce
If you have a runnable example, please include it as a snippet or link to a repository/gist for larger code examples.
I install sdk through composer, and I send it to call in an index.php file, is:
Additional context
Any additional information relevant to the issue. Examples include any framework you may be using (e.g. Laravel, Wordpress) in conjunction with the AWS SDK for PHP, or PHP/environment config settings if the issue is related to memory or performance.
The text was updated successfully, but these errors were encountered: