Skip to content

Commit a0727a2

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

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Binding/HTTPRedirect.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use SimpleSAML\SAML2\Binding;
1313
use SimpleSAML\SAML2\Compat\ContainerSingleton;
1414
use SimpleSAML\SAML2\Constants as C;
15+
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
1516
use SimpleSAML\SAML2\Utils;
1617
use SimpleSAML\SAML2\XML\samlp\AbstractMessage;
1718
use SimpleSAML\SAML2\XML\samlp\AbstractRequest;
@@ -168,7 +169,8 @@ public function receive(ServerRequestInterface $request): AbstractMessage
168169
* message MUST contain the URL to which the sender has instructed the user agent to deliver the
169170
* message.
170171
*/
171-
Assert::notNull($message->getDestination()); // Validation of the value must be done upstream
172+
Assert::notNull($message->getDestination(), ProtocolViolationException::class);
173+
// Validation of the Destination must be done upstream
172174

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

0 commit comments

Comments
 (0)