Skip to content

Commit 7177b3f

Browse files
authored
Throw a more specific ProtocolViolationException
1 parent a0727a2 commit 7177b3f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Binding/HTTPPost.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Psr\Http\Message\ServerRequestInterface;
1111
use SimpleSAML\Assert\Assert;
1212
use SimpleSAML\SAML2\Binding;
13+
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
1314
use SimpleSAML\SAML2\Utils;
1415
use SimpleSAML\SAML2\XML\samlp\AbstractMessage;
1516
use SimpleSAML\SAML2\XML\samlp\AbstractRequest;
@@ -106,7 +107,8 @@ public function receive(ServerRequestInterface $request): AbstractMessage
106107
* message.
107108
*/
108109
if ($msg->isSigned()) {
109-
Assert::notNull($msg->getDestination()); // Validation of the value must be done upstream
110+
Assert::notNull($msg->getDestination(), ProtocolViolationException::class);
111+
// Validation of the Destination must be done upstream
110112
}
111113

112114
if (array_key_exists('RelayState', $query)) {

0 commit comments

Comments
 (0)