From 10c86efc231c8be45cb8b970baaee03818510e84 Mon Sep 17 00:00:00 2001 From: GeekBy Date: Thu, 29 Feb 2024 19:38:59 +0800 Subject: [PATCH 1/2] Fix ChangeFileContentInChangeEdit --- gerrit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gerrit.go b/gerrit.go index 5dfa904..6f601af 100644 --- a/gerrit.go +++ b/gerrit.go @@ -279,8 +279,8 @@ func (c *Client) NewRawPutRequest(ctx context.Context, urlStr string, body strin // Request compact JSON // See https://gerrit-review.googlesource.com/Documentation/rest-api.html#output - req.Header.Add("Accept", "application/json") - req.Header.Add("Content-Type", "application/x-www-form-urlencoded") + // req.Header.Add("Accept", "application/json") + // req.Header.Add("Content-Type", "application/x-www-form-urlencoded") // TODO: Add gzip encoding // Accept-Encoding request header is set to gzip From c79337d58554a46b77da45865c2cf450b6bf3df9 Mon Sep 17 00:00:00 2001 From: GeekBy Date: Thu, 29 Feb 2024 19:42:04 +0800 Subject: [PATCH 2/2] Fix ChangeFileContentInChangeEdit --- gerrit.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gerrit.go b/gerrit.go index 6f601af..490be9d 100644 --- a/gerrit.go +++ b/gerrit.go @@ -281,6 +281,8 @@ func (c *Client) NewRawPutRequest(ctx context.Context, urlStr string, body strin // See https://gerrit-review.googlesource.com/Documentation/rest-api.html#output // req.Header.Add("Accept", "application/json") // req.Header.Add("Content-Type", "application/x-www-form-urlencoded") + req.Header.Add("Accept", "*/*") + req.Header.Add("Content-Type", "text/plain") // TODO: Add gzip encoding // Accept-Encoding request header is set to gzip