Skip to content

Commit

Permalink
Trim whitespaces from access token
Browse files Browse the repository at this point in the history
Required to remove newline character at the end of the file
that might be added by an editor
  • Loading branch information
itz-Jana committed Nov 9, 2024
1 parent 84ef9af commit 4d55950
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"gopkg.in/yaml.v2"
"os"
"path/filepath"
"strings"
)

func Read(path string) (config types.Configuration, err error) {
Expand All @@ -25,7 +26,7 @@ func Read(path string) (config types.Configuration, err error) {
if err != nil {
return config, err
}
config.Remotes[i].Auth.AccessToken = string(content)
config.Remotes[i].Auth.AccessToken = strings.TrimSpace(string(content))
}
if remote.Timeout == 0 {
config.Remotes[i].Timeout = 300
Expand Down

0 comments on commit 4d55950

Please sign in to comment.