src/Control/Middleware/CanonicalURLMiddleware.php
public function throwRedirectIfNeeded(HTTPRequest $request = null)
    {
        $request = $this->getOrValidateRequest($request);
        if (!$request) {
            return;
        }
        $response = $this->getRedirect($request);
        if ($response) {
            throw new HTTPResponse_Exception($response);
        }
    }
public function throwRedirectIfNeeded(HTTPRequest $request = null)
    {
        $request = $this->getOrValidateRequest($request);
        if (!$request) {
            return;
        }
        $response = $this->getRedirect($request);
        if ($response) {
            throw new HTTPResponse_Exception($response);
        }
    }
public function throwRedirectIfNeeded ( HTTPRequest $ request = null ) { $ request = $ this -> getOrValidateRequest ( $ request ) ; if ( ! $ request ) { return ; } $ response = $ this -> getRedirect ( $ request ) ; if ( $ response ) { throw new HTTPResponse_Exception ( $ response ) ; } }
Handles redirection to canonical urls outside of the main middleware chain
using HTTPResponseException.
Will not do anything if a current HTTPRequest isn't available

@param HTTPRequest|null $request Allow HTTPRequest to be used for the base comparison
@throws HTTPResponse_Exception
Handles redirection to canonical urls outside of the main middleware chain using HTTPResponseException . Will not do anything if a current HTTPRequest isn t available