fix(service/microsoft): remove the explicitly specified content-length #557
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #510
I believe that the http client of Zotero would set the correct content-length header. And this is a forbidden header, which means that the programmer should not explicitly set this (the user agent would set this correctly).
For the issue mentioned in #510, it could not translate from Chinese to English. And the status code returned is 400. So this might be due to setting of wrong Content-Length and zotero does not implicitly reject the setting. For unicode other than ascii, the string length is not equal to the content-length. Which has made this error.
Resolving this by removing
Content-Length
header.Documentation: https://learn.microsoft.com/en-us/azure/ai-services/translator/reference/v3-0-reference
Tested this locally: