Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionServeController.php
Show First 20 Lines • Show All 421 Lines • ▼ Show 20 Lines | private function serveGitRequest( | ||||
if (!$bin) { | if (!$bin) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Unable to find `%s` in %s!', | 'Unable to find `%s` in %s!', | ||||
'git-http-backend', | 'git-http-backend', | ||||
'$PATH')); | '$PATH')); | ||||
} | } | ||||
// NOTE: We do not set HTTP_CONTENT_ENCODING here, because we already | |||||
// decompressed the request when we read the request body, so the body is | |||||
// just plain data with no encoding. | |||||
$env = array( | $env = array( | ||||
'REQUEST_METHOD' => $_SERVER['REQUEST_METHOD'], | 'REQUEST_METHOD' => $_SERVER['REQUEST_METHOD'], | ||||
'QUERY_STRING' => $query_string, | 'QUERY_STRING' => $query_string, | ||||
'CONTENT_TYPE' => $request->getHTTPHeader('Content-Type'), | 'CONTENT_TYPE' => $request->getHTTPHeader('Content-Type'), | ||||
'HTTP_CONTENT_ENCODING' => $request->getHTTPHeader('Content-Encoding'), | |||||
'REMOTE_ADDR' => $_SERVER['REMOTE_ADDR'], | 'REMOTE_ADDR' => $_SERVER['REMOTE_ADDR'], | ||||
'GIT_PROJECT_ROOT' => $repository_root, | 'GIT_PROJECT_ROOT' => $repository_root, | ||||
'GIT_HTTP_EXPORT_ALL' => '1', | 'GIT_HTTP_EXPORT_ALL' => '1', | ||||
'PATH_INFO' => $request_path, | 'PATH_INFO' => $request_path, | ||||
'REMOTE_USER' => $viewer->getUsername(), | 'REMOTE_USER' => $viewer->getUsername(), | ||||
// TODO: Set these correctly. | // TODO: Set these correctly. | ||||
▲ Show 20 Lines • Show All 289 Lines • Show Last 20 Lines |