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

Re: [PATCH 2/2] Smart-http: check if repository is OK to export before serving it

From
Shawn O. Pearce <spearce@spearce.org>
Date
Dec 28, 2009, 17:08 UTC
Message-ID
<20091228170811.GE2252@spearce.org>
In-Reply-To
<905315640912280857g710b45fcne21a21d53ff0fedf@mail.gmail.com>
Tarmigan <tarmigan+git@gmail.com> wrote:
Show 19 quoted lines
> On Mon, Dec 28, 2009 at 10:59 AM, Shawn O. Pearce <spearce@spearce.org> wrote:
> > Tarmigan <tarmigan+git@gmail.com> wrote:
> >> I've been thinking that the not_found() to a forbidden() instead.
> >
> > Because you can't resolve the access error by authenticating to
> > the server, we may actually want to just return not_found() here
> > with a message in the log of "Repository not exported: '%s'".
> 
> I'm no http expert, but isn't that what 401 would be?  From
> http://tools.ietf.org/html/rfc2616#section-10.4.4
> 403 Forbidden
>    The server understood the request, but is refusing to fulfill it.
>    Authorization will not help and the request SHOULD NOT be repeated.
>    If the request method was not HEAD and the server wishes to make
>    public why the request has not been fulfilled, it SHOULD describe the
>    reason for the refusal in the entity.  If the server does not wish to
>    make this information available to the client, the status code 404
>    (Not Found) can be used instead.
> which to me points to 403 instead of 404.
Good point, that is 403.  But the last sentance leads me to believe
404 might be a better use here.  Under git-daemon we don't tell
the client the difference between "Not Found" and "Not Exported",
so I think we should be doing the same thing here under HTTP.
 
-- 
Shawn.
Previous: TarmiganNext: Tarmigan Casebolt
Message 10 of 14 in “Does smart-http need git-daemon-export-ok?”
  1. TarmiganDec 26, 2009
  2. Junio C HamanoDec 26, 2009
  3. 1/2 Smart-http: Add tests and documentation for export-okTarmigan Casebolt, Dec 26, 2009
  4. 2/2 Smart-http: check if repository is OK to export before serving itTarmigan Casebolt, Dec 26, 2009
  5. Shawn O. PearceDec 27, 2009
  6. TarmiganDec 28, 2009
  7. Smart-http: check if repository is OK to export before serving itTarmigan Casebolt, Dec 28, 2009
  8. Shawn O. PearceDec 28, 2009
  9. TarmiganDec 28, 2009
  10. Shawn O. PearceDec 28, 2009
  11. Smart-http: check if repository is OK to export before serving itTarmigan Casebolt, Dec 28, 2009
  12. Junio C HamanoDec 29, 2009
  13. Shawn O. PearceDec 29, 2009
  14. Shawn O. PearceDec 27, 2009

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.