Open drakejin opened 3 years ago
https://github.com/valyala/fasthttp/blob/master/header.go#L1123-1126
func (h *RequestHeader) Add(key, value string) {
k := getHeaderKeyBytes(&h.bufKV, key, h.disableNormalizing)
h.h = appendArg(h.h, b2s(k), value, argsHasValue)
switch(key) {
case fiber.HeaderBlah:
h.SetContentType(value)
}
....
}
https://github.com/drakejin/aws-lambda-go-api-proxy/blob/master/fiber/adapter.go#L88-L110
for key, val := range r.Header {
for _, v := range val {
req.Header.Add(key, v)
if key == fiber.HeaderContentType {
req.Header.SetContentType(v) // this solution is wack but, It's my best. (i don't know fasttext
}
}
}
Um....................... I've 2 solutions but, both are not good.
Hm... I'll make a PR
Just spent a few hours on this same error, came to the same conclusion after debugging please merge this
Thanks gofiber team.
Sorry for my poor English. This issue about PR #69
Bug
My HTTP client(Chrome browser) transfers HTTP packets with a 'Content-Type' header to the AWS API gateway. But, My fiber application cannot read a 'Content-Type' header when using a lambda fiber adapter.
test code
below code is part of this link
Plz, Check these codes fiberlambda_test.go, adapter.go. It explains what happened to lambda fiber adapter codes. ). It explains what happened to lambda fiber adapter codes.
Root cause
I think this root cause is below this line. It didn't consider about fasttext's header. fasttext/~~/header.go
I don't have any idea to fix this problem. This below code is my best. sorry, It didn't help
help @Fenny @kiyonlin