From a8199d889af6db63f71eabc19e98e76614ee8625 Mon Sep 17 00:00:00 2001 From: Noooste Date: Mon, 21 Aug 2023 18:39:19 +0200 Subject: [PATCH 1/3] [~] modify env variables name --- connection_proxy_test.go | 12 ++++++------ session_test.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/connection_proxy_test.go b/connection_proxy_test.go index 5bdbbc8..6e8a7b8 100644 --- a/connection_proxy_test.go +++ b/connection_proxy_test.go @@ -11,7 +11,7 @@ var skipProxy bool func TestProxyDialer_Dial(t *testing.T) { session := NewSession() - if err := session.SetProxy(os.Getenv("HTTP_PROXY")); err != nil { + if err := session.SetProxy(os.Getenv("NON_SECURE_PROXY")); err != nil { skipProxy = true t.Fatal(err) } @@ -81,11 +81,11 @@ func TestProxy(t *testing.T) { session.InsecureSkipVerify = true - if os.Getenv("HTTP_PROXY") == "" { - t.Fatal("TestProxy failed, HTTP_PROXY is not set") + if os.Getenv("NON_SECURE_PROXY") == "" { + t.Fatal("TestProxy failed, NON_SECURE_PROXY is not set") } - session.SetProxy(os.Getenv("HTTP_PROXY")) + session.SetProxy(os.Getenv("NON_SECURE_PROXY")) response, err = session.Get("https://api.ipify.org/") @@ -104,7 +104,7 @@ func TestProxy2(t *testing.T) { session := NewSession() session.H2Proxy = true - if err := session.SetProxy(os.Getenv("HTTP_PROXY")); err != nil { + if err := session.SetProxy(os.Getenv("NON_SECURE_PROXY")); err != nil { t.Fatal(err) } @@ -119,7 +119,7 @@ func TestProxy3(t *testing.T) { session := NewSession() session.H2Proxy = true - if err := session.SetProxy(os.Getenv("HTTPS_PROXY")); err != nil { + if err := session.SetProxy(os.Getenv("SECURE_PROXY")); err != nil { t.Fatal(err) } diff --git a/session_test.go b/session_test.go index abe2ebb..d27b5b5 100644 --- a/session_test.go +++ b/session_test.go @@ -60,7 +60,7 @@ func TestSession_Ip(t *testing.T) { oldIP := string(response.Body) - if err = session.SetProxy(os.Getenv("HTTP_PROXY")); err != nil { + if err = session.SetProxy(os.Getenv("NON_SECURE_PROXY")); err != nil { t.Fatal(err) } From 79592ef94e94e96028a12082885e23731b581392 Mon Sep 17 00:00:00 2001 From: Noooste Date: Mon, 21 Aug 2023 18:42:30 +0200 Subject: [PATCH 2/3] [~] modify env variables name --- .github/workflows/coverage.yml | 4 ++-- .github/workflows/push.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fb15817..00ad82c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -33,8 +33,8 @@ jobs: go test -v ./... -covermode=count -coverprofile=coverage.out go tool cover -func=coverage.out -o=coverage.out env: - HTTPS_PROXY: ${{ secrets.HTTPS_PROXY }} - HTTP_PROXY: ${{ secrets.HTTP_PROXY }} + SECURE_PROXY: ${{ secrets.SECURE_PROXY }} + NON_SECURE_PROXY: ${{ secrets.NON_SECURE_PROXY }} - name: Go Coverage Badge # Pass the `coverage.out` output to this action uses: tj-actions/coverage-badge-go@v2 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d8d7acc..58d2356 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -14,5 +14,5 @@ jobs: - name: Run tests run: go test -cover ./... env: - HTTPS_PROXY: ${{ secrets.HTTPS_PROXY }} - HTTP_PROXY: ${{ secrets.HTTP_PROXY }} \ No newline at end of file + SECURE_PROXY: ${{ secrets.SECURE_PROXY }} + NON_SECURE_PROXY: ${{ secrets.NON_SECURE_PROXY }} \ No newline at end of file From 85662792100345b134386d38d7021bb3157bfbb6 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 21 Aug 2023 16:46:38 +0000 Subject: [PATCH 3/3] chore: Updated coverage badge. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 386844c..07f0cfd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # AzureTLS Client [![GoDoc](https://godoc.org/github.com/Noooste/azuretls-client?status.svg)](https://godoc.org/github.com/Noooste/azuretls-client) -![Coverage](https://img.shields.io/badge/Coverage-83.5%25-brightgreen) +![Coverage](https://img.shields.io/badge/Coverage-84.3%25-brightgreen) [![build](https://github.com/Noooste/azuretls-client/actions/workflows/push.yml/badge.svg?branch=improvement)](https://github.com/Noooste/azuretls-client/actions/workflows/push.yml) [![Go Report Card](https://goreportcard.com/badge/Noooste/azuretls-client)](https://goreportcard.com/report/Noooste/azuretls-client) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/Noooste/azuretls-client/blob/master/LICENSE)