git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Drew Green via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Drew Green <agreenbhm@gmail.com>
Subject: Re: [PATCH v2] Added Curl Option to Override Request Method v2
Date: Tue, 26 Apr 2022 21:28:40 +0000	[thread overview]
Message-ID: <YmhkCAbmNE8A7Wqy@camp.crustytoothpaste.net> (raw)
In-Reply-To: <pull.1225.v2.git.1650988659280.gitgitgadget@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1741 bytes --]

On 2022-04-26 at 15:57:39, Drew Green via GitGitGadget wrote:
> From: agreenbhm <agreenbhm@gmail.com>
> 
> Added support for environment variable "CURLOPT_CUSTOMREQUEST"
> and config option "http.customrequest" to allow setting the Curl
> option to override the default request method used by HTTP Git
> operations.  Primary reason for this is to allow support for
> cloning repositories where only GET requests
> are allowed by a local web proxy but not POSTs.  When cloning
> a repo first a GET is made to the server and then a
> POST is made to the "git-upload-pack" endpoint.  In some
> corporate environments with strong controls
> only GET requests are allowed to known repository hosts (such
> as GitHub) through a web proxy to prevent data leakage.  Using this
> new setting, a user can set the "CURLOPT_CUSTOMREQUEST=GET" env at runtime
> or "http.customrequest = GET" in their config file which will
> change the second request from a POST to a GET, bypassing
> web proxy restrictions on the type of requests allowed.
> Tested with GitHub, changing the request from POST to GET still
> results in the expected behavior of the repo successfully being cloned.

I don't think this is a good idea.  It may happen that GitHub or other
servers happen to accept a GET request here, but that is a bug and
should be fixed.  It is definitely not something we should depend on or
rely on, and it isn't a documented part of the protocol.

If your corporate environment doesn't allow POST requests, you may wish
to use SSH for Git operations instead, or you may need to explain to
your company why you cannot do your job with their proxy in place.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

      reply	other threads:[~2022-04-26 21:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26 11:01 [PATCH] Added Curl Option to Override Request Method Drew Green via GitGitGadget
2022-04-26 15:57 ` [PATCH v2] Added Curl Option to Override Request Method v2 Drew Green via GitGitGadget
2022-04-26 21:28   ` brian m. carlson [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

  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=YmhkCAbmNE8A7Wqy@camp.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=agreenbhm@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    /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).