public function fixIfNoneMatchHeader(EventInterface $event) {
        $request = $event->getRequest();
        $ifNoneMatch = $request->headers->get('if-none-match', false);

        if ($ifNoneMatch && strlen($ifNoneMatch) > 34) {
            // Remote quotes
            $ifNoneMatch = trim($ifNoneMatch, '"');

            // Remove everything beyond char 32, that has possibly been added by web servers, and
            // set the header
            $request->headers->set('if-none-match', '"' . substr($ifNoneMatch, 0, 32) . '"');
        }
    }
public function fixIfNoneMatchHeader(EventInterface $event) {
        $request = $event->getRequest();
        $ifNoneMatch = $request->headers->get('if-none-match', false);

        if ($ifNoneMatch && strlen($ifNoneMatch) > 34) {
            // Remote quotes
            $ifNoneMatch = trim($ifNoneMatch, '"');

            // Remove everything beyond char 32, that has possibly been added by web servers, and
            // set the header
            $request->headers->set('if-none-match', '"' . substr($ifNoneMatch, 0, 32) . '"');
        }
    }
public function fixIfNoneMatchHeader ( EventInterface $ event ) { $ request = $ event -> getRequest ( ) ; $ ifNoneMatch = $ request -> headers -> get ( 'if-none-match' , false ) ; if ( $ ifNoneMatch && strlen ( $ ifNoneMatch ) > 34 ) { // Remote quotes $ ifNoneMatch = trim ( $ ifNoneMatch , '"' ) ; // Remove everything beyond char 32, that has possibly been added by web servers, and // set the header $ request -> headers -> set ( 'if-none-match' , '"' . substr ( $ ifNoneMatch , 0 , 32 ) . '"' ) ; } }
Clean up a possibly tainted If-None-Match request header

Apache for instance can add "-gzip" to the ETag response header value, causing the matching
in Imbo to fail when this value comes back with a "-gzip" appended to it.

@param EventInterface $event The current event
Clean up a possibly tainted If - None - Match request header