git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: Jeff KingNext: Luke Madhanga
Message 3 of 5 in “Why is my git-http-backend solution using WebDAV on push?”
  1. Luke MadhangaMay 25, 2016
  2. Jeff KingMay 25, 2016
  3. Luke MadhangaMay 25, 2016
  4. Luke MadhangaMay 25, 2016
  5. Junio C HamanoMay 25, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.