403 response from AWS is translated to 200 response
Closed this issue ยท 4 comments
Hi there!
Thanks for aws-es-proxy
, it's proven to be very useful to me :-)
While using it, I noticed some incoherent results (e.g. missing documents) in AWS ElasticSearch and a lot of Generated fresh AWS Credentials object
log messages.
This message is emitted in lines 159-164:
resp, err := http.DefaultClient.Do(req)
if err != nil {
// ...
}
if !p.nosignreq {
// AWS credentials expired, need to generate fresh ones
if resp.StatusCode == 403 {
p.credentials = nil
return
}
}
defer resp.Body.Close()
Based on some experiments, I noticed that this will return an HTTP 200 response to the caller (see https://play.golang.org/p/pNKInme_sHz). I would either expect a retry or forwarding the 403 response back to the caller.
I guess we might want to remove the return
statement on this line?
I saw the same issue when I provided aws-es-proxy an incorrect AWS credential.
Let me add ๐ to forward 403 response back to the caller!
I saw the same issue when I provided aws-es-proxy an incorrect AWS credential.
Me too.
Like @AndreLouisCaron says, #40 fixes this issue, I suppose?