Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Julian Gruber <[email protected]>
  • Loading branch information
2 people authored and hannahhoward committed Jun 26, 2023
1 parent c4e8b9e commit 0bf23f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/lassie/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var daemonFlags = []cli.Flag{
FlagProviderTimeout,
&cli.StringFlag{
Name: "access-token",
Usage: "require HTTP clients to authorize using Bearer scheme and the configured access token",
Usage: "require HTTP clients to authorize using Bearer scheme and given access token",
Value: "",
},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (s *HttpServer) Close() error {
}

func authorizationMiddleware(next http.Handler, accessToken string) http.Handler {
requiredHeaderValue := "Bearer " + accessToken
requiredHeaderValue := fmt.Sprintf("Bearer %s", accessToken)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Header.Get("Authorization") == requiredHeaderValue {
next.ServeHTTP(w, r)
Expand Down

0 comments on commit 0bf23f9

Please sign in to comment.