Hmmmm. Interesting.

When you look at the PHP code, you'll see the following

    $res = self::proc_open("{$gitcoredir}/git-http-backend", [],
$gitdir, true, [...]);
    ...
    $resbits = explode("\n", $res);
    foreach ($resbits as $index => $header) {
        if ($header && strpos($header, ':') !== false) {
            // Headers
            header($header);
            unset($resbits[$index]);
        } else {
            // First blank line is the space between the headers and
the start of the response from Git
            break;
        }
    }
    echo ltrim(implode("\n", $resbits));
    exit;


Everything being returned is from a direct call to the git-http-backend.

A manual CLI call to git-http-backend doesn't include
'application/x-git-receive-pack-advertisement'

REQUEST_METHOD=GET GIT_PROJECT_ROOT=/path/to/core/
PATH_INFO=/repo.git/info/refs /usr/lib/git-core/git-http-backend

The above command outputs

Expires: Fri, 01 Jan 1980 00:00:00 GMT
Pragma: no-cache
Cache-Control: no-cache, max-age=0, must-revalidate
Content-Length: 118
Content-Type: text/plain

f4648182f5f8eee082c37a83a0072cfc4210e5c5 refs/heads/master
8c4efcd77809bc9b94a59cf94653add8007c6b7d refs/heads/zztest
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to