Open Shahab96 opened 1 year ago
I am currently running in to the same problem using the negroni adapter.
I have come to the conclusion that there's a problem with ProxyWithContext
.
It seems the requestContext is not added to the request.
If you're willing to give up the request context you can use fiberLambda.Proxy
, however this is not a real solution.
To bypass this for now we can add the requestContext to the context manully:
return fiberLambda.ProxyWithContext(context.WithValue(ctx, requestContext, req.RequestContext), req)
And in your handler, access the requestContext using:
reqCtx := req.Context().Value(RequestContext)
@sapessi (Sorry for the direct tag) is this inteded, and if not, I could provide a fix to add the requestContext on the ProxyWithContext
.
What do you think? :)
Hi @Shahab96 , I am using same setup Fiber+HTTP(v2) gateway + aws-lambda-go-api-proxy v0.14.0.
I implemented a Post /auth/login endpoint as dummy endpoing and I am struggling with next error
{
"statusCode": 404,
"headers": {
"Content-Type": "text/plain; charset=utf-8"
},
"multiValueHeaders": null,
"body": "Cannot GET /",
"cookies": []
}
All requests are pointing to GET / , I wonder if you had this issue? or you can share more details of your setup?
I'm currently using fiber for my app and have a handler which will be given data passed through by a custom auth lambda. I am unable to access the lambda event from within my handler however. I'm currently using ProxyWithContextV2 to run my app, but I can't seem to find a way to extract the event data from within the handler.