requestEnd: Add proper support for buffers in body
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
This commit is contained in:
parent
95e6c2dcac
commit
7401b3bd2c
2 changed files with 5 additions and 2 deletions
|
@ -989,7 +989,10 @@ ctx.state.nonce = nonce;
|
|||
|
||||
let length = 0
|
||||
|
||||
if (typeof(body) === 'object' && body) {
|
||||
if (body instanceof Buffer) {
|
||||
length = body.byteLength
|
||||
ctx.type = ctx.type || 'application/octet-stream'
|
||||
} else if (typeof(body) === 'object' && body) {
|
||||
body = JSON.stringify(body)
|
||||
length = Buffer.byteLength(body)
|
||||
ctx.type = 'application/json; charset=utf-8'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "flaska",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"description": "Flaska is a micro web-framework for node. It is designed to be fast, simple and lightweight, and is distributed as a single file module with no dependencies.",
|
||||
"main": "flaska.mjs",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in a new issue