Class Guzzle\Plugin\Md5\Md5ValidatorPlugin

InheritanceGuzzle\Plugin\Md5\Md5ValidatorPlugin
ImplementsSymfony\Component\EventDispatcher\EventSubscriberInterface

Ensures that an the MD5 hash of an entity body matches the Content-MD5 header (if set) of an HTTP response. An exception is thrown if the calculated MD5 does not match the expected MD5.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$contentEncoded bool Whether or not to compare when a Content-Encoding is present Guzzle\Plugin\Md5\Md5ValidatorPlugin
$contentLengthCutoff int Maximum Content-Length in bytes to validate Guzzle\Plugin\Md5\Md5ValidatorPlugin

Property Details

$contentEncoded protected property

Whether or not to compare when a Content-Encoding is present

protected bool $contentEncoded null
$contentLengthCutoff protected property

Maximum Content-Length in bytes to validate

protected int $contentLengthCutoff null

Method Details

__construct() public method

public void __construct ( $contentEncoded true, $contentLengthCutoff false )
$contentEncoded bool

Calculating the MD5 hash of an entity body where a Content-Encoding was

                                 applied is a more expensive comparison because the entity body will need to
                                 be compressed in order to get the correct hash.  Set to FALSE to not
                                 validate the MD5 hash of an entity body with an applied Content-Encoding.
$contentLengthCutoff bool|int

Maximum Content-Length (bytes) in which a MD5 hash will be validated. Any

                                 response with a Content-Length greater than this value will not be validated
                                 because it will be deemed too memory intensive.
getSubscribedEvents() public static method

public static void getSubscribedEvents ( )
onRequestComplete() public method

{@inheritdoc}

public void onRequestComplete ( Guzzle\Common\Event $event )
$event
throws Guzzle\Common\Exception\UnexpectedValueException