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 a0727a2 commit 7177b3f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Binding/HTTPPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Psr\Http\Message\ServerRequestInterface;
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\Binding;
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 @@ -106,7 +107,8 @@ public function receive(ServerRequestInterface $request): AbstractMessage
* message.
*/
if ($msg->isSigned()) {
Assert::notNull($msg->getDestination()); // Validation of the value must be done upstream
Assert::notNull($msg->getDestination(), ProtocolViolationException::class);
// Validation of the Destination must be done upstream
}

if (array_key_exists('RelayState', $query)) {
Expand Down

0 comments on commit 7177b3f

Please sign in to comment.