cds-plugin-ui5 0.6.4 → 0.6.6

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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.6.6](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/cds-plugin-ui5@0.6.5...cds-plugin-ui5@0.6.6) (2023-09-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **cds-plugin-ui5:** disable compression for CDS livereload ([#841](https://github.com/ui5-community/ui5-ecosystem-showcase/issues/841)) ([9589436](https://github.com/ui5-community/ui5-ecosystem-showcase/commit/9589436ac6891a35335e857ddef7afbdf5ed323f))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.6.5](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/cds-plugin-ui5@0.6.4...cds-plugin-ui5@0.6.5) (2023-09-10)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **cds-plugin-ui5:** only rewrite with status code 200 ([5b3f46e](https://github.com/ui5-community/ui5-ecosystem-showcase/commit/5b3f46e42f516066382074bc1231fdf0bfcaa92a))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [0.6.4](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/cds-plugin-ui5@0.6.3...cds-plugin-ui5@0.6.4) (2023-09-10)
7
29
 
8
30
 
@@ -20,6 +20,12 @@ module.exports = async function createPatchedRouter() {
20
20
  // rewite the path to simulate requests on the root level
21
21
  req.originalUrl = req.url;
22
22
  req.baseUrl = "/";
23
+ // disable the compression for fixing issues with the cds-livereload-middleware
24
+ // which ignores the gzipped response from the UI5 tooling serveResources
25
+ const accept = req.headers["accept"]?.indexOf("html") !== -1;
26
+ if (accept) {
27
+ req.headers["accept-encoding"] = "identity";
28
+ }
23
29
  // override UI5 server directory listing if:
24
30
  // 1.) not handled by the CDS Plugin UI5 already
25
31
  // 2.) only if it ends with a slash
@@ -47,14 +47,14 @@ module.exports = async function rewriteHTML(req, res, rewriteCondition, rewriteC
47
47
 
48
48
  // remove the content-length header
49
49
  res.writeHead = function () {
50
- if (!rewriteCondition(res)) return end.apply(this, arguments);
50
+ if (res.statusCode !== 200 || !rewriteCondition(res)) return writeHead.apply(this, arguments);
51
51
  res.removeHeader("content-length");
52
52
  return writeHead.apply(this, arguments);
53
53
  };
54
54
 
55
55
  // intercepts the response end to parse the HTML content
56
56
  res.end = function (content, encoding) {
57
- if (!rewriteCondition(res)) return end.apply(this, arguments);
57
+ if (res.statusCode !== 200 || !rewriteCondition(res)) return end.apply(this, arguments);
58
58
 
59
59
  // store the last chunk in the content buffer
60
60
  contentBuffer.push(content instanceof Buffer ? content.toString(encoding) : content);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cds-plugin-ui5",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "A CAP server cds-plugin to inject the middlewares of all related UI5 tooling based projects.",
5
5
  "author": "Peter Muessig",
6
6
  "license": "Apache-2.0",
@@ -24,5 +24,5 @@
24
24
  "@sap/cds": ">=6.8.2",
25
25
  "express": ">=4.18.2"
26
26
  },
27
- "gitHead": "423a54e264aff78d664bc4f7a1aa2fcd30ce2142"
27
+ "gitHead": "b1228fd96f51170725e17933e96f1726910f0e3f"
28
28
  }