mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-19 20:32:35 +02:00
style: gofmt and fix golangcl-ilint
This commit is contained in:
parent
71ca8c738e
commit
54d7508f5d
4 changed files with 4 additions and 6 deletions
|
@ -194,7 +194,7 @@ func parseClaims(idToken *oidc.IDToken) (*IDTokenClaims, error) {
|
||||||
return nil, fmt.Errorf("failed to parse claims: %w", err)
|
return nil, fmt.Errorf("failed to parse claims: %w", err)
|
||||||
}
|
}
|
||||||
if claim.Username == "" {
|
if claim.Username == "" {
|
||||||
return nil, fmt.Errorf("missing username in ID token")
|
return nil, errors.New("missing username in ID token")
|
||||||
}
|
}
|
||||||
return &claim, nil
|
return &claim, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ package accesslog_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
. "github.com/yusing/go-proxy/internal/logging/accesslog"
|
|
||||||
"github.com/yusing/go-proxy/internal/docker"
|
"github.com/yusing/go-proxy/internal/docker"
|
||||||
|
. "github.com/yusing/go-proxy/internal/logging/accesslog"
|
||||||
"github.com/yusing/go-proxy/internal/utils"
|
"github.com/yusing/go-proxy/internal/utils"
|
||||||
expect "github.com/yusing/go-proxy/internal/utils/testing"
|
expect "github.com/yusing/go-proxy/internal/utils/testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -16,7 +16,7 @@ func warnNoMatchDomains() {
|
||||||
var warnNoMatchDomainOnce sync.Once
|
var warnNoMatchDomainOnce sync.Once
|
||||||
|
|
||||||
const (
|
const (
|
||||||
HeaderXGoDoxyWebsocketAllowedDomains = "X-GoDoxy-Websocket-Allowed-Domains"
|
HeaderXGoDoxyWebsocketAllowedDomains = "X-Godoxy-Websocket-Allowed-Domains"
|
||||||
)
|
)
|
||||||
|
|
||||||
func WebsocketAllowedDomains(h http.Header) []string {
|
func WebsocketAllowedDomains(h http.Header) []string {
|
||||||
|
@ -62,7 +62,6 @@ func Periodic(w http.ResponseWriter, r *http.Request, interval time.Duration, do
|
||||||
defer conn.CloseNow()
|
defer conn.CloseNow()
|
||||||
|
|
||||||
if err := do(conn); err != nil {
|
if err := do(conn); err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +74,6 @@ func Periodic(w http.ResponseWriter, r *http.Request, interval time.Duration, do
|
||||||
return
|
return
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
if err := do(conn); err != nil {
|
if err := do(conn); err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ func TestEntrypointBypassRoute(t *testing.T) {
|
||||||
}
|
}
|
||||||
err := entry.SetMiddlewares([]map[string]any{
|
err := entry.SetMiddlewares([]map[string]any{
|
||||||
{
|
{
|
||||||
"use": "redirectHTTP",
|
"use": "redirectHTTP",
|
||||||
"bypass": []string{"route test-route"},
|
"bypass": []string{"route test-route"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue