Example #1
0
 /**
  * Sets the HTTP1.0 Expires header on the response if a max age has been
  * defined to attempt compatibility with older browsers.
  *
  * @return void
  */
 protected function setExpires()
 {
     if (isset($this->parts["max-age"])) {
         $expires = new \DateTime();
         $expires->add(new \DateInterval("PT{$this->parts["max-age"]}S"));
         $this->response->setDateHeader("Expires", $expires);
     } else {
         if (isset($this->parts["no-cache"])) {
             $this->response->setHeader("Expires", -1);
         }
     }
 }
Example #2
0
 /**
  * Ensure a date is sent with the Response.
  *
  * @link https://tools.ietf.org/html/rfc2616#section-14.18
  * @return void
  */
 protected function ensureDate()
 {
     if (!$this->response->hasHeader("Date")) {
         $this->response->setDateHeader("Date", new \DateTime());
     }
 }