Exemplo n.º 1
0
 private function checkRequestHeader(Gpf_Net_Server_Http_Request $request)
 {
     //HTTP/1.1 All Internet-based HTTP/1.1 servers MUST respond with a 400
     //         (Bad Request) status code to any HTTP/1.1 request message which
     //         lacks a Host header field.
     if ($request->getVersion() == '1.1' && !$request->existsHeader('Host')) {
         $response = Gpf_Net_Server_Http_Response::createBadRequest("Host header is missing");
         throw new Gpf_Net_Server_Http_RequestException($response);
     }
     //        if($request->existsHeader('TE')) {
     //            $response = Gpf_Net_Server_Http_Response::createUnimplemented(
     //                "Transfer-Encoding not supported");
     //            throw new Gpf_Net_Server_Http_RequestException($response);
     //        }
     if ($request->headerContain('Content-Type', 'multipart/byteranges')) {
         $response = Gpf_Net_Server_Http_Response::createUnimplemented("Content-Type multipart/byteranges not supported");
         throw new Gpf_Net_Server_Http_RequestException($response);
     }
 }