Skip to content

Commit

Permalink
Remove whitespace around token from file
Browse files Browse the repository at this point in the history
Before this change, any whitespace in the file would cause panic: Get
"https://api.fastmail.com/jmap/session": net/http: invalid header field
value for "Authorization".
  • Loading branch information
wheelercj committed Nov 4, 2024
1 parent 4b52dcc commit 78f93ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/jmap_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func makeJmapCall(httpMethod, url, token, body string) (*http.Response, error) {
return nil, err
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token))
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", strings.TrimSpace(token)))
return http.DefaultClient.Do(req)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func runFunc(cmd *cobra.Command, args []string) {
// rootCmd represents the base command when called without any subcommands.
var rootCmd = &cobra.Command{
Use: "email-linter",
Version: "v0.0.6",
Version: "v0.0.7",
Run: runFunc,
Short: "Easily find spam and phishing emails received at disposable email addresses.",
}
Expand Down

0 comments on commit 78f93ba

Please sign in to comment.