mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-19 15:01:22 +02:00
fix(agent): correct usage of task in StartAgentServer and updated test expectations
This commit is contained in:
@@ -100,7 +100,7 @@ func TestUserPassLoginCallbackHandler(t *testing.T) {
|
||||
}
|
||||
auth.PostAuthCallbackHandler(w, req)
|
||||
if tt.wantErr {
|
||||
expect.Equal(t, w.Code, http.StatusUnauthorized)
|
||||
expect.Equal(t, w.Code, http.StatusBadRequest)
|
||||
} else {
|
||||
setCookie := expect.Must(http.ParseSetCookie(w.Header().Get("Set-Cookie")))
|
||||
expect.True(t, setCookie.Name == auth.TokenCookieName())
|
||||
|
||||
@@ -56,7 +56,7 @@ func TestBypassCIDR(t *testing.T) {
|
||||
|
||||
func TestBypassPath(t *testing.T) {
|
||||
mr, err := ModifyRequest.New(map[string]any{
|
||||
"bypass": []string{"path /test/*", "path /api"},
|
||||
"bypass": []string{"path glob(/test/*)", "path /api"},
|
||||
"set_headers": map[string]string{
|
||||
"Test-Header": "test-value",
|
||||
},
|
||||
@@ -106,7 +106,7 @@ func TestReverseProxyBypass(t *testing.T) {
|
||||
rp := reverseproxy.NewReverseProxy("test", url, fakeRoundTripper{})
|
||||
err = PatchReverseProxy(rp, map[string]OptionsRaw{
|
||||
"response": {
|
||||
"bypass": "path /test/* | path /api",
|
||||
"bypass": "path glob(/test/*) | path /api",
|
||||
"set_headers": map[string]string{
|
||||
"Test-Header": "test-value",
|
||||
},
|
||||
|
||||
@@ -474,6 +474,9 @@ func (r *Route) HomepageItem() homepage.Item {
|
||||
}
|
||||
|
||||
func (r *Route) DisplayName() string {
|
||||
if r.Homepage == nil { // should only happen in tests, Validate() should initialize it
|
||||
return r.Alias
|
||||
}
|
||||
return r.Homepage.Name
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user