/** * {@inheritdoc} */ public function isSecure() { if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_PROTO] && ($proto = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO])->getValueString())) { return in_array(strtolower(current(explode(',', $proto))), array('https', 'on', 'ssl', '1')); } $https = $this->server['HTTPS']; return !empty($https) && strtolower($https) !== 'off'; }
/** * {@inheritdoc} */ public function setDate(\DateTime $date) { $date->setTimezone(new \DateTimeZone('UTC')); $this->headers->add(HttpHeader::create('Date', $date->format('D, d M Y H:i:s') . ' GMT')); }