Re: [PATCH] Docs: web server must setenv GIT_PROTOCOL for v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 09, 2021 at 10:35:51AM -0700, Junio C Hamano wrote:

> Junio C Hamano <gitster@xxxxxxxxx> writes:
> 
> >> @@ -789,6 +790,9 @@ int cmd_main(int argc, const char **argv)
> >>  	http_config();
> >>  	max_request_buffer = git_env_ulong("GIT_HTTP_MAX_REQUEST_BUFFER",
> >>  					   max_request_buffer);
> >> +	proto_header = getenv("HTTP_GIT_PROTOCOL");
> >> +	if (proto_header)
> >> +		setenv(GIT_PROTOCOL_ENVIRONMENT, proto_header, 1);
> 
> Since this overwrites (I noticed the "1" at the end), the server
> operator cannot force a particular protocol with their server
> configuration, no?
> 
> Would a weaker form to use 0 (set if there isn't any, but keep the
> value if somebody else already has set it) work OK?  Would that have
> a downside?

Yeah, I wondered about that while writing it, but struggled to think of
a reason why the server operator would want to set it at all.

But maybe as a workaround for some misbehaving client (e.g., recognizing
it by a user-agent header). Or we could even perhaps use this in our
tests to test the v2-client-to-v0-server fallback behavior.

I'll re-roll with that change, plus some documentation changes adapted
to this new approach.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux