Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ChangeFileContentInChangeEdit function error #158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jackbai233
Copy link

os:

  • Gerrit server version: 3.4.1

desc:

When I try to use the ChangeFileContentInChangeEdit function to update (or create) file in the remote gerrit server, although no error is reported, the local update content cannot be uploaded to the remote file.
After I used chrome developer tools to manually debug and compare, I found that it was an api request header problem:here. After setting the request header to be the same as in chrome:

req.Header.Add("Accept", "*/*")
req.Header.Add("Content-Type", "text/plain")

or delete the json setting:

// req.Header.Add("Accept", "application/json")
// req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

then call this function, the file content can be updated remote server normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant