Ejemplo n.º 1
0
 protected static function createHeaders(Sabel_Response $response)
 {
     $headers = array();
     $status = $response->getStatus();
     $httpVersion = "HTTP/" . $response->getHttpVersion();
     $headers[] = $httpVersion . " " . $status->toString();
     if ($response->hasHeaders()) {
         foreach ($response->getHeaders() as $message => $value) {
             $headers[] = ucfirst($message) . ": " . $value;
         }
     }
     if (in_array($status->getCode(), self::$redirectCode, true)) {
         $headers[] = "Location: " . $response->getLocation();
     }
     return $headers;
 }