diff --git a/src/SAML2/XML/idpdisc/DiscoveryResponse.php b/src/SAML2/XML/idpdisc/DiscoveryResponse.php index 2671173b4..08e78af1b 100644 --- a/src/SAML2/XML/idpdisc/DiscoveryResponse.php +++ b/src/SAML2/XML/idpdisc/DiscoveryResponse.php @@ -6,6 +6,7 @@ use SimpleSAML\Assert\Assert; use SimpleSAML\SAML2\Constants as C; +use SimpleSAML\SAML2\Exception\ProtocolViolationException; use SimpleSAML\SAML2\XML\md\AbstractIndexedEndpointType; /** @@ -48,10 +49,11 @@ public function __construct( array $attributes = [], array $children = [], ) { + Assert::same($binding, C::BINDING_IDPDISC, ProtocolViolationException::class); Assert::null( $unused, 'The \'ResponseLocation\' attribute must be omitted for idpdisc:DiscoveryResponse.', ); - parent::__construct($index, $binding, $location, $isDefault, null, $attributes, $children); + parent::__construct($index, C::BINDING_IDPDISC, $location, $isDefault, null, $attributes, $children); } }