mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 20:52:33 +02:00
fix redirectHTTP middleware test
This commit is contained in:
parent
f6dc432419
commit
7bb34b8788
1 changed files with 2 additions and 3 deletions
|
@ -4,7 +4,6 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/yusing/go-proxy/internal/common"
|
|
||||||
"github.com/yusing/go-proxy/internal/net/types"
|
"github.com/yusing/go-proxy/internal/net/types"
|
||||||
. "github.com/yusing/go-proxy/internal/utils/testing"
|
. "github.com/yusing/go-proxy/internal/utils/testing"
|
||||||
)
|
)
|
||||||
|
@ -14,8 +13,8 @@ func TestRedirectToHTTPs(t *testing.T) {
|
||||||
reqURL: types.MustParseURL("http://example.com"),
|
reqURL: types.MustParseURL("http://example.com"),
|
||||||
})
|
})
|
||||||
ExpectNoError(t, err)
|
ExpectNoError(t, err)
|
||||||
ExpectEqual(t, result.ResponseStatus, http.StatusPermanentRedirect)
|
ExpectEqual(t, result.ResponseStatus, http.StatusMovedPermanently)
|
||||||
ExpectEqual(t, result.ResponseHeaders.Get("Location"), "https://example.com:"+common.ProxyHTTPSPort)
|
ExpectEqual(t, result.ResponseHeaders.Get("Location"), "https://example.com")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNoRedirect(t *testing.T) {
|
func TestNoRedirect(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue