Skip to content

Commit bc0d411

Browse files
author
Donát Hajszter
committed
changing Septima for realCity
1 parent 5e7bf36 commit bc0d411

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/Septima/traefik-api-key-auth
1+
module github.com/realCity/traefik-api-key-auth
22

33
go 1.19

plugin.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type Config struct {
1818
QueryParam bool `json:"queryParam,omitempty"`
1919
QueryParamName string `json:"queryParamName,omitempty"`
2020
PathSegment bool `json:"pathSegment,omitempty"`
21-
removeQueryParamsOnSuccess bool `json:"removeQueryParamsOnSuccess,omitempty"`
21+
RemoveQueryParamsOnSuccess bool `json:"removeQueryParamsOnSuccess,omitempty"`
2222
Keys []string `json:"keys,omitempty"`
2323
RemoveHeadersOnSuccess bool `json:"removeHeadersOnSuccess,omitempty"`
2424
InternalForwardHeaderName string `json:"internalForwardHeaderName,omitempty"`
@@ -39,7 +39,7 @@ func CreateConfig() *Config {
3939
QueryParam: true,
4040
QueryParamName: "token",
4141
PathSegment: true,
42-
removeQueryParamsOnSuccess:true,
42+
RemoveQueryParamsOnSuccess:true,
4343
Keys: make([]string, 0),
4444
RemoveHeadersOnSuccess: true,
4545
InternalForwardHeaderName: "",
@@ -85,7 +85,7 @@ func New(ctx context.Context, next http.Handler, config *Config, name string) (h
8585
queryParam: config.QueryParam,
8686
queryParamName: config.QueryParamName,
8787
pathSegment: config.PathSegment,
88-
removeQueryParamsOnSuccess: config.removeQueryParamsOnSuccess,
88+
removeQueryParamsOnSuccess: config.RemoveQueryParamsOnSuccess,
8989
keys: config.Keys,
9090
removeHeadersOnSuccess: config.RemoveHeadersOnSuccess,
9191
internalForwardHeaderName: config.InternalForwardHeaderName,
@@ -171,7 +171,7 @@ func (ka *KeyAuth) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
171171
var matchedKey = contains(qs.Get(ka.queryParamName), ka.keys, true)
172172
if matchedKey != "" {
173173
if ka.removeQueryParamsOnSuccess{
174-
qs.Del(ka.queryParamName)
174+
qs.Del(ka.queryParamName)
175175
}
176176
req.URL.RawQuery = qs.Encode()
177177
ka.ok(rw, req, matchedKey)

0 commit comments

Comments
 (0)