@adobe/helix-html-pipeline 3.11.2 → 3.11.4
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 +14 -0
- package/package.json +1 -1
- package/src/json-pipe.js +12 -5
- package/src/utils/auth-cookie.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [3.11.4](https://github.com/adobe/helix-html-pipeline/compare/v3.11.3...v3.11.4) (2023-05-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* use SameSite=None for auth cookie ([#305](https://github.com/adobe/helix-html-pipeline/issues/305)) ([5303c17](https://github.com/adobe/helix-html-pipeline/commit/5303c174830755f07019179cf9b53c198f3cf3e1)), closes [#304](https://github.com/adobe/helix-html-pipeline/issues/304)
|
|
7
|
+
|
|
8
|
+
## [3.11.3](https://github.com/adobe/helix-html-pipeline/compare/v3.11.2...v3.11.3) (2023-05-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* compute surrogate keys for unfound json ([#303](https://github.com/adobe/helix-html-pipeline/issues/303)) ([f86afde](https://github.com/adobe/helix-html-pipeline/commit/f86afde9f1bdb98ef98cdaac56e3fa297bb59a55))
|
|
14
|
+
|
|
1
15
|
## [3.11.2](https://github.com/adobe/helix-html-pipeline/compare/v3.11.1...v3.11.2) (2023-04-29)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/json-pipe.js
CHANGED
|
@@ -67,6 +67,13 @@ async function fetchJsonContent(state, req, res) {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
async function computeSurrogateKeys(path, contentBusId) {
|
|
71
|
+
const keys = [];
|
|
72
|
+
keys.push(`${contentBusId}${path}`.replace(/\//g, '_')); // TODO: remove
|
|
73
|
+
keys.push(await computeSurrogateKey(`${contentBusId}${path}`));
|
|
74
|
+
return keys;
|
|
75
|
+
}
|
|
76
|
+
|
|
70
77
|
/**
|
|
71
78
|
* Runs the default pipeline and returns the response.
|
|
72
79
|
* @param {PipelineState} state
|
|
@@ -140,10 +147,7 @@ export async function jsonPipe(state, req) {
|
|
|
140
147
|
});
|
|
141
148
|
|
|
142
149
|
// set surrogate keys
|
|
143
|
-
const keys =
|
|
144
|
-
const { path } = state.info;
|
|
145
|
-
keys.push(`${contentBusId}${path}`.replace(/\//g, '_')); // TODO: remove
|
|
146
|
-
keys.push(await computeSurrogateKey(`${contentBusId}${path}`));
|
|
150
|
+
const keys = await computeSurrogateKeys(state.info.path, contentBusId);
|
|
147
151
|
res.headers.set('x-surrogate-key', keys.join(' '));
|
|
148
152
|
|
|
149
153
|
await setCustomResponseHeaders(state, req, res);
|
|
@@ -159,7 +163,10 @@ export async function jsonPipe(state, req) {
|
|
|
159
163
|
if (res.status < 500) {
|
|
160
164
|
await setCustomResponseHeaders(state, req, res);
|
|
161
165
|
}
|
|
162
|
-
|
|
166
|
+
if (res.status === 404) {
|
|
167
|
+
const keys = await computeSurrogateKeys(state.info.path, contentBusId);
|
|
168
|
+
res.headers.set('x-surrogate-key', keys.join(' '));
|
|
169
|
+
}
|
|
163
170
|
return res;
|
|
164
171
|
}
|
|
165
172
|
}
|
package/src/utils/auth-cookie.js
CHANGED
|
@@ -17,7 +17,7 @@ export function clearAuthCookie(secure) {
|
|
|
17
17
|
httpOnly: true,
|
|
18
18
|
secure,
|
|
19
19
|
expires: new Date(0),
|
|
20
|
-
sameSite: '
|
|
20
|
+
sameSite: 'none',
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -26,7 +26,7 @@ export function setAuthCookie(idToken, secure) {
|
|
|
26
26
|
path: '/',
|
|
27
27
|
httpOnly: true,
|
|
28
28
|
secure,
|
|
29
|
-
sameSite: '
|
|
29
|
+
sameSite: 'none',
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
|