Re: [PATCH 1/6] docs: document bundle URI standard
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 8, 2022, 19:27 UTC
- Message-ID
- <xmqqo7z3q7lm.fsf@gitster.g>
- In-Reply-To
- <9244644f-2c80-f23d-f054-3f0c961696af@github.com>
Derrick Stolee <derrickstolee@github.com> writes:
Show 8 quoted lines
>> How does a client tell which one it got? Do we register mimetype >> with iana to use for these two types of files, and have the HTTP >> downloader to use the information? > > My implementation is much dumber than that: it first attempts to > parse the file as a bundle (looking for a bundle header) and then > attempts to parse it as a config file after that. If neither > succeed, then an error is thrown.
I think that is probably the best implementation after all.
We cannot trust what the other side tells us. "They claimed that this is a bundle file and not a table-of-contents, and it does look like one, but it may be corrupt or even malicious file that may look like a bundle file on surface, so let's carefully examine it" ought to be the attitude the receiving side has towards the incoming data.
Thanks.