@quintype/framework 7.4.2-ttl.0 → 7.4.2-ttl.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server/routes.js +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/framework",
3
- "version": "7.4.2-ttl.0",
3
+ "version": "7.4.2-ttl.1",
4
4
  "description": "Libraries to help build Quintype Node.js apps",
5
5
  "main": "index.js",
6
6
  "engines": {
package/server/routes.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * @category Server
7
7
  * @module routes
8
8
  */
9
-
9
+ const { match } = require("path-to-regexp");
10
10
  const { generateServiceWorker } = require("./handlers/generate-service-worker");
11
11
  const {
12
12
  handleIsomorphicShell,
@@ -70,7 +70,10 @@ exports.upstreamQuintypeRoutes = function upstreamQuintypeRoutes(
70
70
  parseInt(_sMaxAge) > 0 &&
71
71
  apiProxy.on("proxyRes", function (proxyRes, req) {
72
72
  const pathName = get(req, ["originalUrl"], "").split("?")[0];
73
- const checkForExcludeRoutes = excludeRoutes.includes(pathName);
73
+ const checkForExcludeRoutes = excludeRoutes.some((path) => {
74
+ const matchFn = match(path, { decode: decodeURIComponent });
75
+ return matchFn(pathName);
76
+ });
74
77
  const getCacheControl = get(proxyRes, ["headers", "cache-control"], "");
75
78
  if (!checkForExcludeRoutes && getCacheControl.includes("public")) {
76
79
  proxyRes.headers["cache-control"] = getCacheControl.replace(/s-maxage=\d*/g, `s-maxage=${_sMaxAge}`);
@@ -91,7 +94,7 @@ exports.upstreamQuintypeRoutes = function upstreamQuintypeRoutes(
91
94
  "/qlitics.js",
92
95
  "/api/v1/breaking-news",
93
96
  "/stories.rss",
94
- "/collection.rss",
97
+ "/api/v1/collections/:slug.rss",
95
98
  "/api/v1/advanced-search",
96
99
  ];
97
100