Skip to content

Commit

Permalink
Merge pull request #181 from chriskuehl/user-agent
Browse files Browse the repository at this point in the history
Set User-Agent from cli requests
  • Loading branch information
chriskuehl authored Nov 16, 2024
2 parents 410e595 + a04b92a commit 6af78c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cli/fpb/fpb.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ Example usage:
return fmt.Errorf("creating request: %w", err)
}
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req.Header.Set("User-Agent", "fpb/"+version)
if creds != nil {
req.SetBasicAuth(creds.Username, creds.Password)
}
Expand Down
1 change: 1 addition & 0 deletions cli/fput/fput.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ var command = &cobra.Command{
return fmt.Errorf("creating request: %w", err)
}
req.Header.Set("Content-Type", writer.FormDataContentType())
req.Header.Set("User-Agent", "fput/"+version)
if creds != nil {
req.SetBasicAuth(creds.Username, creds.Password)
}
Expand Down

0 comments on commit 6af78c9

Please sign in to comment.