Skip to content

Commit

Permalink
fix: set http header when put harbor configuration (#578)
Browse files Browse the repository at this point in the history
Signed-off-by: chlins <chlins.zhang@gmail.com>
  • Loading branch information
chlins committed Apr 21, 2021
1 parent cac18f3 commit 163dcfd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/harbor/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func (c *client) ApplyConfiguration(ctx context.Context, config []byte) error {
if err != nil {
return fmt.Errorf("new request error: %w", err)
}
// with header
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
// with auth
if c.opts.credential != nil {
req.SetBasicAuth(c.opts.credential.username, c.opts.credential.password)
Expand Down

0 comments on commit 163dcfd

Please sign in to comment.