Skip to content

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.

@jackbai233 jackbai233 force-pushed the fix-changefilecontent branch from f4fec8b to c79337d Compare March 3, 2024 01:31
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.

1 participant