You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And I am using the proxy from a client-side react app; the app and the proxy are on different domains. So for correct operation, a CORS setup is required. Prior to a search request via the proxy, the browser sends a CORS preflight OPTIONS request. This does not have a basic auth header, and according to the specifications, preflight requests are not supposed to have any credentials.
However the proxy rejects the preflight request with a 401 because it is lacking credentials. And subsequently this causes the browser to abort the the actual search request.
This can be confirmed with the following CURL requests:
I have forked this repo and added the check for request method. And I have deployed this forked and modified repo to my proxy host. The problem with authentication errors on preflight requests has been resolved.
I have installed the aws-es-proxy with the following runtime options:
And I am using the proxy from a client-side react app; the app and the proxy are on different domains. So for correct operation, a CORS setup is required. Prior to a search request via the proxy, the browser sends a CORS preflight OPTIONS request. This does not have a basic auth header, and according to the specifications, preflight requests are not supposed to have any credentials.
However the proxy rejects the preflight request with a 401 because it is lacking credentials. And subsequently this causes the browser to abort the the actual search request.
This can be confirmed with the following CURL requests:
Will fail with a 401
Will succeed with a 200
In the aws-es-proxy.go code there should probably be a check for the request method not being an OPTIONS request before authenticating the request.
The text was updated successfully, but these errors were encountered: