@aeriajs/node-http 0.0.100 → 0.0.101
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/dist/driver.js +5 -2
- package/dist/driver.mjs +5 -2
- package/package.json +2 -2
package/dist/driver.js
CHANGED
|
@@ -13,10 +13,13 @@ const getBody = async ($req) => {
|
|
|
13
13
|
return Buffer.concat(bodyParts).toString();
|
|
14
14
|
};
|
|
15
15
|
const abstractRequest = async (request) => {
|
|
16
|
-
|
|
16
|
+
if (!request.url || !request.method) {
|
|
17
|
+
throw new Error;
|
|
18
|
+
}
|
|
19
|
+
const url = request.url;
|
|
17
20
|
const req = Object.assign(request, {
|
|
18
21
|
url,
|
|
19
|
-
method:
|
|
22
|
+
method: request.method,
|
|
20
23
|
headers: request.headers,
|
|
21
24
|
body: request.headers['x-stream-request']
|
|
22
25
|
? undefined
|
package/dist/driver.mjs
CHANGED
|
@@ -11,10 +11,13 @@ const getBody = async ($req) => {
|
|
|
11
11
|
return Buffer.concat(bodyParts).toString();
|
|
12
12
|
};
|
|
13
13
|
export const abstractRequest = async (request) => {
|
|
14
|
-
|
|
14
|
+
if (!request.url || !request.method) {
|
|
15
|
+
throw new Error();
|
|
16
|
+
}
|
|
17
|
+
const url = request.url;
|
|
15
18
|
const req = Object.assign(request, {
|
|
16
19
|
url,
|
|
17
|
-
method: request.method
|
|
20
|
+
method: request.method,
|
|
18
21
|
headers: request.headers,
|
|
19
22
|
body: request.headers["x-stream-request"] ? void 0 : await getBody(request),
|
|
20
23
|
query: url.includes("?") ? parseUrl(url, true).query : {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/node-http",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.101",
|
|
4
4
|
"description": "## Installation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@aeriajs/http": "link:../http"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@aeriajs/http": "^0.0.
|
|
28
|
+
"@aeriajs/http": "^0.0.101"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"test": "echo skipping",
|