change conf to argsset and flag for oauth
This commit is contained in:
14
main_test.go
14
main_test.go
@@ -34,8 +34,8 @@ func TestHTTPSMain(t *testing.T) {
|
||||
"username",
|
||||
"-pass",
|
||||
"password",
|
||||
"-r",
|
||||
"hello:" + addr,
|
||||
"-proxy",
|
||||
"hello," + addr,
|
||||
"-crt",
|
||||
"./testdata/rproxy3server.crt",
|
||||
"-key",
|
||||
@@ -51,7 +51,7 @@ func TestHTTPSMain(t *testing.T) {
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
},
|
||||
}
|
||||
r, _ := http.NewRequest("GET", "https://hello.localhost"+port, nil)
|
||||
r, _ := http.NewRequest("GET", "https://hello.localhost:"+port, nil)
|
||||
|
||||
if resp, err := client.Do(r); err != nil {
|
||||
t.Fatalf("client failed: %v", err)
|
||||
@@ -89,8 +89,8 @@ func TestHTTPMain(t *testing.T) {
|
||||
"username",
|
||||
"-pass",
|
||||
"password",
|
||||
"-r",
|
||||
"hello:" + addr,
|
||||
"-proxy",
|
||||
"hello," + addr,
|
||||
}
|
||||
main()
|
||||
}()
|
||||
@@ -98,7 +98,7 @@ func TestHTTPMain(t *testing.T) {
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
|
||||
client := &http.Client{}
|
||||
r, _ := http.NewRequest("GET", "http://hello.localhost"+port, nil)
|
||||
r, _ := http.NewRequest("GET", "http://hello.localhost:"+port, nil)
|
||||
|
||||
if resp, err := client.Do(r); err != nil {
|
||||
t.Fatalf("client failed: %v", err)
|
||||
@@ -127,5 +127,5 @@ func echoServer() (string, func()) {
|
||||
func getPort() string {
|
||||
s := httptest.NewServer(nil)
|
||||
s.Close()
|
||||
return s.URL[strings.LastIndex(s.URL, ":"):]
|
||||
return s.URL[strings.LastIndex(s.URL, ":")+1:]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user