qcobjects-cli 2.5.139-beta → 2.5.141-beta
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/VERSION +1 -1
- package/package.json +1 -1
- package/public/browser/main-http-gae-server.js +8 -0
- package/public/browser/main-http-gae-server.js.map +2 -2
- package/public/browser/main-http-server.js +9 -0
- package/public/browser/main-http-server.js.map +2 -2
- package/public/browser/main-http2-server.js +20 -4
- package/public/browser/main-http2-server.js.map +2 -2
- package/public/cjs/main-http-gae-server.cjs +8 -0
- package/public/cjs/main-http-gae-server.cjs.map +2 -2
- package/public/cjs/main-http-server.cjs +9 -0
- package/public/cjs/main-http-server.cjs.map +2 -2
- package/public/cjs/main-http2-server.cjs +20 -4
- package/public/cjs/main-http2-server.cjs.map +2 -2
- package/public/esm/main-http-gae-server.mjs +8 -0
- package/public/esm/main-http-gae-server.mjs.map +2 -2
- package/public/esm/main-http-server.mjs +9 -0
- package/public/esm/main-http-server.mjs.map +2 -2
- package/public/esm/main-http2-server.mjs +20 -4
- package/public/esm/main-http2-server.mjs.map +2 -2
- package/public/types/index.d.ts.map +1 -1
- package/src/main-http-gae-server.ts +12 -1
- package/src/main-http-server.ts +12 -1
- package/src/main-http2-server.ts +26 -7
package/src/main-http-server.ts
CHANGED
|
@@ -247,9 +247,20 @@ class HTTPServerResponse extends InheritClass {
|
|
|
247
247
|
stream
|
|
248
248
|
});
|
|
249
249
|
var self = this;
|
|
250
|
+
self.request = request || {};
|
|
250
251
|
self.stream = stream;
|
|
251
|
-
self.
|
|
252
|
+
self.headers = headers;
|
|
253
|
+
self.body = body;
|
|
254
|
+
self.fileDispatcher = fileDispatcher;
|
|
255
|
+
|
|
256
|
+
// Initialize request properties if not set
|
|
257
|
+
if (!self.request.scriptname || !self.request.pathname) {
|
|
258
|
+
const defaultPath = "/";
|
|
259
|
+
self.request.pathname = self.request.pathname || defaultPath;
|
|
260
|
+
self.request.scriptname = self.request.scriptname || CONFIG.get("documentRootFileIndex", "index.html");
|
|
261
|
+
}
|
|
252
262
|
|
|
263
|
+
self._generateResponse();
|
|
253
264
|
}
|
|
254
265
|
|
|
255
266
|
sendFile(stream: any, fileName: string) {
|
package/src/main-http2-server.ts
CHANGED
|
@@ -64,7 +64,7 @@ const ImportMicroservice = function (microservicePackage: string) {
|
|
|
64
64
|
class HTTP2ServerResponse extends InheritClass {
|
|
65
65
|
fileDispatcher: any;
|
|
66
66
|
request: any;
|
|
67
|
-
headers!: { [x: string]: number
|
|
67
|
+
headers!: { [x: string]: string | number };
|
|
68
68
|
stream: any;
|
|
69
69
|
body: any;
|
|
70
70
|
constructor({
|
|
@@ -80,8 +80,20 @@ class HTTP2ServerResponse extends InheritClass {
|
|
|
80
80
|
}) {
|
|
81
81
|
super();
|
|
82
82
|
var self = this;
|
|
83
|
+
self.request = request || {};
|
|
84
|
+
self.stream = stream;
|
|
85
|
+
self.headers = headers;
|
|
86
|
+
self.body = body;
|
|
87
|
+
self.fileDispatcher = fileDispatcher;
|
|
88
|
+
|
|
89
|
+
// Initialize request properties if not set
|
|
90
|
+
if (!self.request.scriptname || !self.request.pathname) {
|
|
91
|
+
const defaultPath = "/";
|
|
92
|
+
self.request.pathname = self.request.pathname || defaultPath;
|
|
93
|
+
self.request.scriptname = self.request.scriptname || CONFIG.get("documentRootFileIndex", "index.html");
|
|
94
|
+
}
|
|
95
|
+
|
|
83
96
|
self._generateResponse();
|
|
84
|
-
|
|
85
97
|
}
|
|
86
98
|
|
|
87
99
|
sendFile(stream: { respondWithFD: (arg0: any, arg1: { "content-length": any; "last-modified": any; "content-type": any; "cache-control": any; }) => void; on: (arg0: string, arg1: { (): void; (): void; }) => void; end: () => void; respond: (arg0: { ":status": number; "content-type": any; }) => void; write: (arg0: string) => void; }, fileName: string) {
|
|
@@ -305,13 +317,20 @@ export class HTTP2Server extends InheritClass {
|
|
|
305
317
|
http2ServerInstance.request.method = headers[":method"];
|
|
306
318
|
http2ServerInstance.request.path = headers[":path"];
|
|
307
319
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
320
|
+
// Fix pathname and scriptname initialization
|
|
321
|
+
const pathParts = http2ServerInstance.request.pathname.split("/");
|
|
322
|
+
if (pathParts.length > 0) {
|
|
323
|
+
if (http2ServerInstance.request.pathname.indexOf(".") < 0) {
|
|
324
|
+
http2ServerInstance.request.scriptname = CONFIG.get("documentRootFileIndex", "index.html");
|
|
325
|
+
// Keep the original pathname as is, no need to reassign
|
|
326
|
+
} else {
|
|
327
|
+
http2ServerInstance.request.scriptname = pathParts[pathParts.length - 1];
|
|
328
|
+
http2ServerInstance.request.pathname = http2ServerInstance.request.pathname.substr(0, http2ServerInstance.request.pathname.lastIndexOf("/"));
|
|
329
|
+
}
|
|
311
330
|
} else {
|
|
312
|
-
http2ServerInstance.request.scriptname =
|
|
331
|
+
http2ServerInstance.request.scriptname = CONFIG.get("documentRootFileIndex", "index.html");
|
|
332
|
+
http2ServerInstance.request.pathname = "/";
|
|
313
333
|
}
|
|
314
|
-
http2ServerInstance.request.pathname = this.request.pathname.substr(0, http2ServerInstance.request.pathname.lastIndexOf("/"));
|
|
315
334
|
|
|
316
335
|
logger.debug(PipeLog.pipe(this.request));
|
|
317
336
|
|