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(service/microsoft): remove the explicitly specified content-length #557

Merged
merged 1 commit into from
Aug 25, 2023
Merged

fix(service/microsoft): remove the explicitly specified content-length #557

merged 1 commit into from
Aug 25, 2023

Conversation

yin1999
Copy link
Contributor

@yin1999 yin1999 commented Aug 25, 2023

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:

image

@windingwind windingwind merged commit 69c02db into windingwind:main Aug 25, 2023
@yin1999 yin1999 deleted the fix-microsoft branch August 25, 2023 07:42
Copy link

github-actions bot commented Jul 6, 2024

🚀 This ticket has been resolved in v1.1.0-beta.50. See Release v1.1.0-beta.50 for release notes.

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.

使用微软翻译api时翻译内容中有特殊字符会返回 400错误
2 participants