Closed NyuBlara closed 9 months ago
Thanks for the ticket. I'll take a look at it over the weekend
@cjvnjde same issue here
In version 4.3, it is now possible to include custom headers.
like so
translate(text, { headers: { something: "something" } })
After attempting to use the package with the default CORS proxy URL (http://cors-anywhere.herokuapp.com/), and encountering a 403 error, I then attempted to use two separate proxy servers : CorsProxy.io and CORS.SH.
With both of these servers, the package reports a
NetworkError
, and the underlying error is as follows :Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at [PROXY URL]/https://translate.google.com/_/TranslateWebserverUi/data/batchexecute. [...] (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
For reference, the calling code is the following :
This seems to suggest that proper headers are not added to the POST request for proxy servers other than the default.