git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jan Engelhardt <jengelh@inai.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] http-backend: give a hint that web browser access is not supported
Date: Sat, 04 Dec 2021 17:17:08 -0800	[thread overview]
Message-ID: <xmqqtufnonor.fsf@gitster.g> (raw)
In-Reply-To: <7r23s082-o3q0-479o-srqn-r45q778s5nq7@vanv.qr> (Jan Engelhardt's message of "Sat, 4 Dec 2021 12:09:52 +0100 (CET)")

Jan Engelhardt <jengelh@inai.de> writes:

> On Saturday 2021-12-04 09:09, Junio C Hamano wrote:
>
>>Jan Engelhardt <jengelh@inai.de> writes:
>>
>>> When using a browser to access a URI that is served by http-backend,
>>> nothing but a blank page is shown. This is not helpful.
>>>
>>> Emit the same "Request not handled" messages, but to the CGI stream
>>
>>Puzzled.  Same with what?
>
> "Request not handled" is already sent to stderr, which means it (only)
> shows up in the httpd error log.
>
> So now we send "Request not handled" also to stdout, which is what
> the browser will see.
>
>>What is in "pathinfo" parameter?
>
> It is getenv("PATH_INFO").

That part I know.  The question was what would a typical value of
that parameter look like in the context of somebody mistakenly
visiting Git smart HTTP endpoint via their browser.

I am basically wondering if it is helping the user enough, or if it
is sufficient to give just the "err" and "hint", and nothing else.

> Yes, that seems more like it. I was not aware of send_strbuf.

Heh, I wasn't either.  The review of this topic was the first time I
seriously read any part of that file, and I think I still only read
just about 20% of it ;-)

Also, will the real Git clients, which are the primary intended
audiences this program is trying to talk to, be OK if we suddenly
start giving a non-empty 404 page?

If any implementations of Git HTTP client this program is serving
(1) uses a 404 response as a cue to decide its next request
(e.g. there may be some "try this URL and if it fails, do another
one" fallback logic), and (2) depends on our 404 response to be
without any body, we'd be breaking the service for our primary
audience, only to mollify those who visit our HTTP endpoint that
they should not be visiting in the first place via the browser,
which would be worse than embarrassing.

Thanks.

  reply	other threads:[~2021-12-05  1:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02  0:39 [PATCH] http-backend: give a hint that web browser access is not supported Jan Engelhardt
2021-12-02  7:38 ` Junio C Hamano
2021-12-02 10:27   ` RFE: Split diff.noprefix for git-diff and git-format-patch (was: http-backend: give a hint that web browser access is not supported) Jan Engelhardt
2021-12-02 17:20     ` RFE: Split diff.noprefix for git-diff and git-format-patch Junio C Hamano
2021-12-02 10:28   ` [PATCH] http-backend: give a hint that web browser access is not supported Jan Engelhardt
2021-12-04  8:09     ` Junio C Hamano
2021-12-04 11:09       ` Jan Engelhardt
2021-12-05  1:17         ` Junio C Hamano [this message]
2021-12-05 10:13           ` Jan Engelhardt
2021-12-05 20:13             ` Junio C Hamano
2021-12-05 23:07               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqtufnonor.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jengelh@inai.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).