fixIfNoneMatchHeader() публичный Метод

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.
public fixIfNoneMatchHeader ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The current event
Пример #1
0
 /**
  * @dataProvider getTaintedHeaders
  */
 public function testCanFixATaintedInNoneMatchHeader($incoming, $real, $willFix)
 {
     $requestHeaders = $this->getMock('Symfony\\Component\\HttpFoundation\\HeaderBag');
     $requestHeaders->expects($this->once())->method('get')->with('if-none-match', false)->will($this->returnValue($incoming));
     if ($willFix) {
         $requestHeaders->expects($this->once())->method('set')->with('if-none-match', $real);
     } else {
         $requestHeaders->expects($this->never())->method('set');
     }
     $request = $this->getMock('Imbo\\Http\\Request\\Request');
     $request->headers = $requestHeaders;
     $event = $this->getMock('Imbo\\EventManager\\Event');
     $event->expects($this->once())->method('getRequest')->will($this->returnValue($request));
     $this->listener->fixIfNoneMatchHeader($event);
 }