-
Notifications
You must be signed in to change notification settings - Fork 32
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
Issue handling multiple types in one header #16
Comments
I think it would not be correct to support (if cant currently) thing like that and maybe we should pass the problem to Alipay tracker to fix their header? |
Right, this module explicitly rejects that header value on purpose. The reason is that we detect if the type of a request is something; if the value in the There are really only two good courses of action here:
|
You can also find some previous discussion on this exact Alipay issue in #12 |
It's also amusing to search Google for the string |
And for reference, you can find the exact format the |
Hm, okey. Just didn't have time to look at google. So @daiwhea, that's the way currently. app.use(function * (next) {
if (this.request.header['content-type'] === 'application/x-www-form-urlencoded; text/html; charset=utf-8') {
this.request.header['content-type'] = 'application/x-www-form-urlencoded'
// or
// this.request.header['content-type'] = 'application/x-www-form-urlencoded; charset=utf-8'
}
yield next
}) I'll think to do something on |
One option with
|
stated at helapkg/hela#22
Problem is that some API service - Alipay, sending request content-type header like that
I dont know why they send it like that, but there's no logic for me. We've tried in different ways, but didn't work.
It's not
koa-better-body
implementation issue, cuz it supportextendTypes
option that pass things to koathis.is
/this.request.is
The text was updated successfully, but these errors were encountered: