alchemymvc 1.3.13 → 1.3.15

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.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/app/routes.js CHANGED
File without changes
@@ -428,7 +428,7 @@ Conduit.setMethod(function setReqRes(req, res) {
428
428
  *
429
429
  * @author Jelle De Loecker <jelle@develry.be>
430
430
  * @since 0.3.3
431
- * @version 1.1.0
431
+ * @version 1.3.15
432
432
  */
433
433
  Conduit.setMethod(function initValues() {
434
434
 
@@ -471,6 +471,9 @@ Conduit.setMethod(function initValues() {
471
471
 
472
472
  // The current active theme
473
473
  this.theme = null;
474
+
475
+ // Make sure the tested routes are reset
476
+ this[TESTED_ROUTES] = null;
474
477
  });
475
478
 
476
479
  /**
@@ -1824,7 +1827,7 @@ Conduit.setMethod(function end(message) {
1824
1827
  *
1825
1828
  * @author Jelle De Loecker <jelle@elevenways.be>
1826
1829
  * @since 0.2.0
1827
- * @version 1.3.10
1830
+ * @version 1.3.14
1828
1831
  */
1829
1832
  Conduit.setMethod(function _end(message, encoding = 'utf-8') {
1830
1833
 
@@ -1862,6 +1865,11 @@ Conduit.setMethod(function _end(message, encoding = 'utf-8') {
1862
1865
 
1863
1866
  for (key in this.response_headers) {
1864
1867
  value = this.response_headers[key];
1868
+
1869
+ if (value == null) {
1870
+ continue;
1871
+ }
1872
+
1865
1873
  this.response.setHeader(key, value);
1866
1874
  }
1867
1875
 
@@ -2126,7 +2134,7 @@ Conduit.setTypedMethod([Types.Stream, Types.Object.optional()], function serveFi
2126
2134
  *
2127
2135
  * @author Jelle De Loecker <jelle@elevenways.be>
2128
2136
  * @since 1.3.0
2129
- * @version 1.3.13
2137
+ * @version 1.3.14
2130
2138
  *
2131
2139
  * @param {Stream} stream The stream to send
2132
2140
  * @param {Object} options Options, including headers
@@ -2182,11 +2190,6 @@ Conduit.setMethod(function _sendStream(stream, options) {
2182
2190
  this.setHeader('content-disposition', disposition);
2183
2191
  }
2184
2192
 
2185
- // Set the content-length response header when not compressing
2186
- if (!options.compress && options.content_length != null) {
2187
- this.setHeader('content-length', options.content_length);
2188
- }
2189
-
2190
2193
  // Set all the headers
2191
2194
  for (key in options.headers) {
2192
2195
  this.setHeader(key, options.headers[key]);
@@ -2204,9 +2207,13 @@ Conduit.setMethod(function _sendStream(stream, options) {
2204
2207
  // Set the gzip header
2205
2208
  this.setHeader('content-encoding', 'gzip');
2206
2209
  this.setHeader('vary', 'accept-encoding');
2210
+ this.setHeader('transfer-encoding', 'chunked');
2211
+ this.setHeader('content-length', null);
2207
2212
 
2208
2213
  // Create the gzip stream
2209
2214
  out_stream = out_stream.pipe(zlib.createGzip());
2215
+ } else if (options.content_length != null) {
2216
+ this.setHeader('content-length', options.content_length);
2210
2217
  }
2211
2218
 
2212
2219
  if (options.cleanup_stream) {
@@ -2229,7 +2236,13 @@ Conduit.setMethod(function _sendStream(stream, options) {
2229
2236
 
2230
2237
  // Set the response headers
2231
2238
  for (key in this.response_headers) {
2232
- response.setHeader(key, this.response_headers[key]);
2239
+ let value = this.response_headers[key];
2240
+
2241
+ if (value == null) {
2242
+ continue;
2243
+ }
2244
+
2245
+ response.setHeader(key, value);
2233
2246
  }
2234
2247
 
2235
2248
  if (this.new_cookie_header.length) {
File without changes
File without changes
File without changes
@@ -444,9 +444,10 @@ Alchemy.setMethod(function minifyScript(path, options, callback) {
444
444
  };
445
445
 
446
446
  if (alchemy.settings.debug && alchemy.settings.source_map) {
447
- minify_options.sourceMap = {
447
+ console.warn('Source maps have been disabled because alchemy.settings.minify_js is true');
448
+ /*minify_options.sourceMap = {
448
449
  url: 'inline'
449
- };
450
+ };*/
450
451
  }
451
452
 
452
453
  result = await Terser.minify(data, minify_options);
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "alchemymvc",
3
3
  "description": "MVC framework for Node.js",
4
- "version": "1.3.13",
4
+ "version": "1.3.15",
5
5
  "author": "Jelle De Loecker <jelle@elevenways.be>",
6
6
  "keywords": [
7
7
  "alchemy",
@@ -36,7 +36,7 @@
36
36
  "socket.io" : "~4.6.0",
37
37
  "@11ways/socket.io-stream" : "~0.9.2",
38
38
  "sputnik" : "~0.1.0",
39
- "terser" : "~5.16.3",
39
+ "terser" : "~5.18.1",
40
40
  "toobusy-js" : "~0.5.1",
41
41
  "useragent" : "~2.3.0"
42
42
  },