-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing Content-Type #341
Comments
Have you checked the contents of |
@mscdex I logged it. It is lower case |
headers: {
...event.headers,
"Content-Type":
event.headers["Content-Type"] || event.headers["content-type"],
}```
I tried updating the string here to have to exactly same case the error is mentioning. |
I don't know what to tell you then as Just to double check, what does |
It logs back as I really feel there might be something on Busboy's end that is messing this up. I think people still have these problems with lamda functions - saw that when I was going through all the issues here |
Well, you'll need to dig into the code and troubleshoot it yourself then because I have no explanation as to why you're receiving that particular error in this case. |
It's not a case-sensitivity issue with content-type. The problem seems to be that the cfg.headers['content-type'] statement returns undefined because the headers in the routing endpoint's request are not a plain map. In a nutshell, try this: const simpleHeaders = {};
for (const key of request.headers.keys()) {
simpleHeaders[key] = request.headers.get(key);
}
const busboy = Busboy({ headers: simpleHeaders }); or const busboy = Busboy({ headers: Object.fromEntries(request.headers) }); |
I was under the impression that this issues had been resolved but it still persists. I have tried both Camel case and Lower case content-type but none of it works. Here is my code
The text was updated successfully, but these errors were encountered: