Skip to content

Commit

Permalink
Merge pull request #892 from superfly/trim-token-whitespace
Browse files Browse the repository at this point in the history
trim whitespace when reading FLY_ACCESS_TOKEN
  • Loading branch information
jsierles committed Apr 1, 2022
2 parents 130daa3 + 35d1ddb commit 67a08e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"strings"
"sync"

"github.com/spf13/pflag"
Expand Down Expand Up @@ -85,6 +86,9 @@ func (cfg *Config) ApplyEnv() {
cfg.AccessToken = env.FirstOrDefault(cfg.AccessToken,
AccessTokenEnvKey, APITokenEnvKey)

// trim whitespace since it causes http errors when passsed to Docker auth
cfg.AccessToken = strings.TrimSpace(cfg.AccessToken)

cfg.VerboseOutput = env.IsTruthy(verboseOutputEnvKey) || cfg.VerboseOutput
cfg.JSONOutput = env.IsTruthy(jsonOutputEnvKey) || cfg.JSONOutput
cfg.LogGQLErrors = env.IsTruthy(logGQLEnvKey) || cfg.LogGQLErrors
Expand Down

0 comments on commit 67a08e8

Please sign in to comment.