Skip to content

Commit

Permalink
Merge pull request #21 from Carnageous/main
Browse files Browse the repository at this point in the history
Minor changes to headers in client.go
  • Loading branch information
muratmirgun authored Nov 21, 2021
2 parents 1a7ca5d + 8e00155 commit 55262c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NewClient(rawURL, schema string, headers map[string]string) *Client {
c.clientTransport.header.Set("Content-Type", "application/json")
c.clientTransport.header.Set("Accept-Profile", schema)
c.clientTransport.header.Set("Content-Profile", schema)
c.clientTransport.header.Set("X-Client-Info: ", "postgrest-go/"+version)
c.clientTransport.header.Set("X-Client-Info", "postgrest-go/"+version)

// Set optional headers if exist
for key, value := range headers {
Expand All @@ -57,6 +57,7 @@ type Client struct {

func (c *Client) TokenAuth(token string) *Client {
c.clientTransport.header.Set("Authorization", "Basic "+token)
c.clientTransport.header.Set("apikey", token)
return c
}

Expand Down

0 comments on commit 55262c0

Please sign in to comment.