@webqit/webflo 0.11.38 → 0.11.39
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/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"vanila-javascript"
|
|
13
13
|
],
|
|
14
14
|
"homepage": "https://webqit.io/tooling/webflo",
|
|
15
|
-
"version": "0.11.
|
|
15
|
+
"version": "0.11.39",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"esbuild": "^0.14.38",
|
|
44
44
|
"form-data-encoder": "^1.6.0",
|
|
45
45
|
"formdata-node": "^4.3.0",
|
|
46
|
-
"formidable": "^2.0.
|
|
46
|
+
"formidable": "^2.0.1",
|
|
47
47
|
"mime-types": "^2.1.33",
|
|
48
48
|
"node-fetch": "^2.6.1",
|
|
49
49
|
"simple-git": "^2.20.1",
|
|
@@ -32,7 +32,7 @@ const RequestHeaders = xRequestHeaders(whatwag.Headers);
|
|
|
32
32
|
const ResponseHeaders = xResponseHeaders(whatwag.Headers);
|
|
33
33
|
const Request = xRequest(whatwag.Request, RequestHeaders, FormData, whatwag.Blob);
|
|
34
34
|
const Response = xResponse(whatwag.Response, ResponseHeaders, FormData, whatwag.Blob);
|
|
35
|
-
const fetch = xfetch(whatwag.fetch
|
|
35
|
+
const fetch = xfetch(whatwag.fetch);
|
|
36
36
|
const HttpEvent = xHttpEvent(Request, Response, URL);
|
|
37
37
|
|
|
38
38
|
export {
|
|
@@ -220,7 +220,12 @@ export default class Runtime extends _Runtime {
|
|
|
220
220
|
* @return Array
|
|
221
221
|
*/
|
|
222
222
|
async parseNodeRequest(proto, request) {
|
|
223
|
-
|
|
223
|
+
let url = request.url;
|
|
224
|
+
// Detected when using manual proxy setting in a browser
|
|
225
|
+
if (url.startsWith(`http://${ request.headers.host }`) || url.startsWith(`https://${ request.headers.host }`)) {
|
|
226
|
+
url = url.split(request.headers.host)[1];
|
|
227
|
+
}
|
|
228
|
+
const fullUrl = proto + '://' + request.headers.host + url;
|
|
224
229
|
const requestInit = { method: request.method, headers: request.headers };
|
|
225
230
|
if (request.method !== 'GET' && request.method !== 'HEAD') {
|
|
226
231
|
requestInit.body = await new Promise((resolve, reject) => {
|
package/src/runtime-pi/xfetch.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* The xfetch Mixin
|
|
4
4
|
*/
|
|
5
|
-
const xfetch = (whatwagFetch, xRequest) => {
|
|
5
|
+
const xfetch = (whatwagFetch, xRequest = null) => {
|
|
6
6
|
return (url, init = {}) => {
|
|
7
|
-
if (init.body && (typeof init.body === 'object')) {
|
|
7
|
+
if (init.body && (typeof init.body === 'object') && xRequest) {
|
|
8
8
|
return whatwagFetch(new xRequest(url, init));
|
|
9
9
|
}
|
|
10
10
|
return whatwagFetch(url, init);
|