Skip to content

Commit

Permalink
Remove requirement for allow_url_fopen
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnylot authored and introwit committed Feb 14, 2023
1 parent 7499bfa commit bf60444
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
},
"require": {
"php": "^8.0",
"illuminate/support": "^9.0",
"aws/aws-php-sns-message-validator": "^1.6",
"illuminate/http": "^9.0",
"illuminate/queue": "^9.0",
"aws/aws-php-sns-message-validator": "^1.6"
"illuminate/support": "^9.0"
},
"extra": {
"laravel": {
Expand All @@ -42,4 +43,4 @@
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
5 changes: 3 additions & 2 deletions src/Controllers/AwsSnsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Aws\Sns\Message;
use Aws\Sns\MessageValidator;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
use JoggApp\AwsSns\Events\SnsMessageReceived;
use JoggApp\AwsSns\Events\SnsTopicSubscriptionConfirmed;

Expand All @@ -17,7 +18,7 @@ public function __invoke()

$validator = new MessageValidator(function ($certUrl) {
return Cache::rememberForever($certUrl, function () use ($certUrl) {
return file_get_contents($certUrl);
return Http::get($certUrl);
});
});

Expand All @@ -30,7 +31,7 @@ public function __invoke()

if (isset($message['Type']) && $message['Type'] === 'SubscriptionConfirmation') {
// Confirm the subscription by sending a GET request to the SubscribeURL
file_get_contents($message['SubscribeURL']);
Http::get($message['SubscribeURL']);

event(new SnsTopicSubscriptionConfirmed);

Expand Down

0 comments on commit bf60444

Please sign in to comment.