Skip to content

Commit

Permalink
Throw a more specific ProtocolViolationException
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen authored Jan 23, 2025
1 parent bba4659 commit a0727a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Binding/HTTPRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use SimpleSAML\SAML2\Binding;
use SimpleSAML\SAML2\Compat\ContainerSingleton;
use SimpleSAML\SAML2\Constants as C;
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
use SimpleSAML\SAML2\Utils;
use SimpleSAML\SAML2\XML\samlp\AbstractMessage;
use SimpleSAML\SAML2\XML\samlp\AbstractRequest;
Expand Down Expand Up @@ -168,7 +169,8 @@ public function receive(ServerRequestInterface $request): AbstractMessage
* message MUST contain the URL to which the sender has instructed the user agent to deliver the
* message.
*/
Assert::notNull($message->getDestination()); // Validation of the value must be done upstream
Assert::notNull($message->getDestination(), ProtocolViolationException::class);
// Validation of the Destination must be done upstream

if (!array_key_exists('SigAlg', $query)) {
throw new Exception('Missing signature algorithm.');
Expand Down

0 comments on commit a0727a2

Please sign in to comment.