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: Sun, 05 Dec 2021 15:07:19 -0800 [thread overview]
Message-ID: <xmqqwnkiirbs.fsf@gitster.g> (raw)
In-Reply-To: <xmqq7dcilsig.fsf@gitster.g> (Junio C. Hamano's message of "Sun, 05 Dec 2021 12:13:27 -0800")
Junio C Hamano <gitster@pobox.com> writes:
> Jan Engelhardt <jengelh@inai.de> writes:
>
>>>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?
>>
>> I am confident enough to say yes. It's not like git-http-backend
>> returned anything previously in the 404 case (like JSON or so),
>> therefore clients could not possibly depend on content.
>>
>>>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)
>>
>> Not sure if they heed Location: headers, but I am not changing
>> that :-)
>
> I was more worried about clients barfing because they depend on
> *not* having content. They parse the status (404) out, and then
> leave the message part untouched---they may not even read the
> message in full, and that did not matter because there wasn't
> anything to read and discard. Now we are sending more.
>
> As long as the leftover bytes would not cause problem with the
> action they take after that step, we would be OK.
In any case, the patch in question seems to fail t5561.
$ cd t && sh t5561-http-backend.sh -i -v
Initialized empty Git repository in /home/jch/git/t/trash directory.t5561-http-backend/.git/
checking prerequisite: NOT_ROOT
...
ok 13 - http.receivepack false
expecting success of 5561.14 'server request log matches test results':
check_access_log exp
--- exp.sorted 2021-12-05 23:05:09.418684299 +0000
+++ access.log.sorted 2021-12-05 23:05:09.422684296 +0000
@@ -1,33 +1,33 @@
GET /smart/repo.git/HEAD HTTP/1.1 200
GET /smart/repo.git/HEAD HTTP/1.1 200
-GET /smart/repo.git/HEAD HTTP/1.1 403
+GET /smart/repo.git/HEAD HTTP/1.1 403 -
GET /smart/repo.git/info/refs HTTP/1.1 200
GET /smart/repo.git/info/refs HTTP/1.1 200
-GET /smart/repo.git/info/refs HTTP/1.1 403
+GET /smart/repo.git/info/refs HTTP/1.1 403 -
GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
-GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403
-GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403
+GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
+GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
-GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 403
+GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 403 -
GET /smart/repo.git/objects/01/494420155a3f7587b6c26d06a55b1a8bbef2f4 HTTP/1.1 200
GET /smart/repo.git/objects/01/494420155a3f7587b6c26d06a55b1a8bbef2f4 HTTP/1.1 200
-GET /smart/repo.git/objects/01/494420155a3f7587b6c26d06a55b1a8bbef2f4 HTTP/1.1 403
+GET /smart/repo.git/objects/01/494420155a3f7587b6c26d06a55b1a8bbef2f4 HTTP/1.1 403 -
GET /smart/repo.git/objects/info/alternates HTTP/1.1 200 -
GET /smart/repo.git/objects/info/alternates HTTP/1.1 200 -
-GET /smart/repo.git/objects/info/alternates HTTP/1.1 403
+GET /smart/repo.git/objects/info/alternates HTTP/1.1 403 -
GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 200 -
GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 200 -
-GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 403
+GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 403 -
GET /smart/repo.git/objects/info/packs HTTP/1.1 200
GET /smart/repo.git/objects/info/packs HTTP/1.1 200
-GET /smart/repo.git/objects/info/packs HTTP/1.1 403
+GET /smart/repo.git/objects/info/packs HTTP/1.1 403 -
GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.idx HTTP/1.1 200
GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.idx HTTP/1.1 200
-GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.idx HTTP/1.1 403
+GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.idx HTTP/1.1 403 -
GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.pack HTTP/1.1 200
GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.pack HTTP/1.1 200
-GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.pack HTTP/1.1 403
+GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.pack HTTP/1.1 403 -
GET /smart/repo.git/refs/heads/main HTTP/1.1 404
GET /smart_noexport/repo.git/HEAD HTTP/1.1 200
GET /smart_noexport/repo.git/HEAD HTTP/1.1 404
@@ -46,8 +46,8 @@
GET /smart_noexport/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.pack HTTP/1.1 200
GET /smart_noexport/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.pack HTTP/1.1 404
POST /smart/repo.git/git-receive-pack HTTP/1.1 200 -
-POST /smart/repo.git/git-receive-pack HTTP/1.1 403
-POST /smart/repo.git/git-receive-pack HTTP/1.1 403
+POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
+POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
-POST /smart/repo.git/git-upload-pack HTTP/1.1 403
+POST /smart/repo.git/git-upload-pack HTTP/1.1 403 -
--- exp 2021-12-05 23:05:09.410684305 +0000
+++ access.log.stripped 2021-12-05 23:05:09.422684296 +0000
@@ -31,23 +31,23 @@
GET /smart/repo.git/objects/01/494420155a3f7587b6c26d06a55b1a8bbef2f4 HTTP/1.1 200
GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.pack HTTP/1.1 200
GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.idx HTTP/1.1 200
-GET /smart/repo.git/HEAD HTTP/1.1 403
-GET /smart/repo.git/info/refs HTTP/1.1 403
-GET /smart/repo.git/objects/info/packs HTTP/1.1 403
-GET /smart/repo.git/objects/info/alternates HTTP/1.1 403
-GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 403
-GET /smart/repo.git/objects/01/494420155a3f7587b6c26d06a55b1a8bbef2f4 HTTP/1.1 403
-GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.pack HTTP/1.1 403
-GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.idx HTTP/1.1 403
+GET /smart/repo.git/HEAD HTTP/1.1 403 -
+GET /smart/repo.git/info/refs HTTP/1.1 403 -
+GET /smart/repo.git/objects/info/packs HTTP/1.1 403 -
+GET /smart/repo.git/objects/info/alternates HTTP/1.1 403 -
+GET /smart/repo.git/objects/info/http-alternates HTTP/1.1 403 -
+GET /smart/repo.git/objects/01/494420155a3f7587b6c26d06a55b1a8bbef2f4 HTTP/1.1 403 -
+GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.pack HTTP/1.1 403 -
+GET /smart/repo.git/objects/pack/pack-977dd2d10981235a806ccc52cc769a44e75c889e.idx HTTP/1.1 403 -
GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
POST /smart/repo.git/git-upload-pack HTTP/1.1 200 -
-GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 403
-POST /smart/repo.git/git-upload-pack HTTP/1.1 403
-GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403
-POST /smart/repo.git/git-receive-pack HTTP/1.1 403
+GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 403 -
+POST /smart/repo.git/git-upload-pack HTTP/1.1 403 -
+GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
+POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
POST /smart/repo.git/git-receive-pack HTTP/1.1 200 -
-GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403
-POST /smart/repo.git/git-receive-pack HTTP/1.1 403
+GET /smart/repo.git/info/refs?service=git-receive-pack HTTP/1.1 403 -
+POST /smart/repo.git/git-receive-pack HTTP/1.1 403 -
not ok 14 - server request log matches test results
#
# check_access_log exp
#
prev parent reply other threads:[~2021-12-05 23:07 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
2021-12-05 10:13 ` Jan Engelhardt
2021-12-05 20:13 ` Junio C Hamano
2021-12-05 23:07 ` Junio C Hamano [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwnkiirbs.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.