Replies: 1 comment
-
|
a PR is welcomed, but if node.js supports it, it's better to allow it. for |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Running the following code and then requesting
127.0.0.1:3000throws an error: "TypeError: type.split is not a function".Because the
Content-Typeheader value is an array, not a string:koa/lib/response.js
Lines 388 to 392 in 0c81a73
Of course, the HTTP specification doesn't allow me to set multiple
Content-Typeheaders, but both Node.js and Koa allow me to do so. When I set more than oneContent-Typeresponse header, I find that Chrome, Edge, Firefox, and Postman all automatically recognize the last one.How should koa, as a framework, position itself?
Validate parameters against the HTTP specification (which Node.js doesn't do)? Something like this:
Or, depending on the situation? Such as:
Beta Was this translation helpful? Give feedback.
All reactions