From 56b18f60ee48ed47e791195dfa542e6b562284a8 Mon Sep 17 00:00:00 2001 From: David Stotijn Date: Fri, 14 May 2021 18:25:44 +0200 Subject: [PATCH] Add `User-Agent` HTTP req header --- client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 3b026f9..a54ccae 100644 --- a/client.go +++ b/client.go @@ -7,8 +7,9 @@ import ( ) const ( - baseURL = "https://api.notion.com/v1" - apiVersion = "2021-05-13" + baseURL = "https://api.notion.com/v1" + apiVersion = "2021-05-13" + clientVersion = "0.0.0" ) // Client is used for HTTP requests to the Notion API. @@ -49,6 +50,7 @@ func (c *Client) newRequest(method, url string, body io.Reader) (*http.Request, req.Header.Set("Authorization", fmt.Sprintf("Bearer %v", c.apiKey)) req.Header.Set("Notion-Version", apiVersion) + req.Header.Set("User-Agent", "go-notion/"+clientVersion) return req, nil }