FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add NO_PROXY env support by sathieu · Pull Request #5796 · libgit2/libgit2 · GitHub

Add NO_PROXY env support - #5796

Closed
sathieu wants to merge 1 commit into
libgit2:mainfrom
sathieu:no_proxy
Closed

sathieu wants to merge 1 commit into
libgit2:mainfrom
sathieu:no_proxy

Conversation

sathieu commented Feb 11, 2021 •
edited
Loading

Copy link
Copy Markdown
Contributor

Item 2 of 3 from #4164.

Note that the behavior is same as wget (and not same as curl). Some examples:

  • "192.168.1.1": Matches exactly the given IP
  • "192.168.1.1:8080": Matches exactly the given IP and port
  • "example.com" : Matches exactly the domain example.com
  • "example.com:8080" : As above, restricting port (handle default ports)
  • ".example.com": Matches every machine in the example.com domain. But NOT example.com (like curl, wget also includes example.com).
  • ".example.com:8080" : As above, restricting port (handle default ports)
  • ".example.com,example.com": Matches every machine in the example.com domain and example.com
  • "foo.example.com": Matches exactly the foo.example.com machine
Wildcards a have no special meaning (i.e. "*.example.com" won't match anything).

sathieu force-pushed the no_proxy branch 3 times, most recently from 47b9651 to 4606649 Compare February 12, 2021 09:06

sathieu commented Feb 12, 2021

Copy link
Copy Markdown
Contributor Author

It looks like Windows is unable to read empty env var:

   1) Failure:
6: online::clone::proxy_credentials_in_environment [D:\a\libgit2\libgit2\tests\online\clone.c:872]
6:   Function call failed: (git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options))
6:   error -1 - could not read environment variable 'no_proxy': 

(See https://github.com/libgit2/libgit2/runs/1885965142?check_suite_focus=true#step:7:3127).

Done this:

diff --git a/tests/online/clone.c b/tests/online/clone.c
index b1c59b3d4..ce581d89d 100644
--- a/tests/online/clone.c
+++ b/tests/online/clone.c
@@ -867,7 +867,7 @@ void test_online_clone__proxy_credentials_in_environment(void)
 
        cl_setenv("HTTP_PROXY", url.ptr);
        cl_setenv("HTTPS_PROXY", url.ptr);
-       cl_setenv("NO_PROXY", "");
+       cl_setenv("NO_PROXY", NULL);
 
        cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options));
 

sathieu commented Feb 12, 2021

Copy link
Copy Markdown
Contributor Author

@ethomson Please review 👀.

sathieu commented Feb 27, 2021

Copy link
Copy Markdown
Contributor Author

@ethomson Would you review this?

Copy link
Copy Markdown
Member

Hi @sathieu! Thanks for the pull request. Sorry for the delay, I've been quite busy with work and home responsibilities. I'll try to take a look 🔜

sathieu commented Mar 20, 2021

Copy link
Copy Markdown
Contributor Author

@ethomson I've rebased. Could you please review?

Item 2 of 3 from libgit2#4164

Signed-off-by: Mathieu Parent <math.parent@gmail.com>

sathieu commented Apr 8, 2021

Copy link
Copy Markdown
Contributor Author

@ethomson Please review. We're using this patch without problems since months.

I've added support for *.example.com with same behavior as .example.com, as some of my colleague use this syntax.

sathieu commented Jun 16, 2021

Copy link
Copy Markdown
Contributor Author

@ethomson Please review this PR. As you look busy: can someone else review?

Copy link
Copy Markdown

I have the same issue, could you please merge? :)

sathieu commented Aug 31, 2021

Copy link
Copy Markdown
Contributor Author

@ethomson Any chance to have this merged in 1.2?

Copy link
Copy Markdown
Member

@sathieu I was actually looking at this last night. I'll suggest some refactorings to reduce the amount of pointer arithmetic and use some of our existing utility functions instead, but yes, I think that we should land this for 1.2.

ethomson commented Sep 2, 2021

Copy link
Copy Markdown
Member

Merged in #6026 with some refactorings to support the other issues in #4164 - thanks, @sathieu!

ethomson closed this Sep 2, 2021

sathieu commented Sep 2, 2021

Copy link
Copy Markdown
Contributor Author

Thanks @ethomson 👍!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL