minimalistic-server 0.0.40 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +1 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3,8 +3,6 @@ import * as querystring from "node:querystring";
|
|
|
3
3
|
import * as fs from "node:fs/promises";
|
|
4
4
|
import * as tls from "node:tls";
|
|
5
5
|
import * as nodeCrypto from "node:crypto";
|
|
6
|
-
import { isTypedArray } from 'node:util/types';
|
|
7
|
-
import { inspect } from 'node:util';
|
|
8
6
|
|
|
9
7
|
const servers = new Map();
|
|
10
8
|
const keepAliveTimeout = 20000;
|
|
@@ -1416,7 +1414,7 @@ export class Request {
|
|
|
1416
1414
|
}
|
|
1417
1415
|
|
|
1418
1416
|
const isString = typeof data === 'string';
|
|
1419
|
-
const buffer = data instanceof Buffer ?
|
|
1417
|
+
const buffer = data instanceof Buffer ? data : (isString ? Buffer.from(data, 'utf-8') : Buffer.from(data));
|
|
1420
1418
|
const length = buffer.length;
|
|
1421
1419
|
|
|
1422
1420
|
let payloadLength = [length];
|