From 519cfacaf24f9adaf6fc305d11eb25491cec3f67 Mon Sep 17 00:00:00 2001 From: Chen-I Lim Date: Wed, 3 Feb 2021 10:42:06 -0800 Subject: [PATCH] Add X-Requested-With to server test --- server/client/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/client/client.go b/server/client/client.go index 82a99d2f9..c6814f3ba 100644 --- a/server/client/client.go +++ b/server/client/client.go @@ -65,7 +65,10 @@ type Client struct { func NewClient(url string) *Client { url = strings.TrimRight(url, "/") - return &Client{url, url + API_URL_SUFFIX, &http.Client{}, map[string]string{}} + headers := map[string]string{ + "X-Requested-With": "XMLHttpRequest", + } + return &Client{url, url + API_URL_SUFFIX, &http.Client{}, headers} } func (c *Client) DoApiGet(url string, etag string) (*http.Response, error) {