Re: Why is my git-http-backend solution using WebDAV on push?
- From
Luke Madhanga <lmadhanga@gmail.com>
- Date
- May 25, 2016, 21:54 UTC
- Message-ID
- <CABwKKP89Ncht0MfB7X1x15a6PB-Nm68SDGEDvX1AnQdDucXQkA@mail.gmail.com>
- In-Reply-To
- <20160525213850.GB13776@sigill.intra.peff.net>
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