@webqit/webflo 0.20.22 → 0.20.24
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/package.json
CHANGED
|
@@ -48,6 +48,20 @@ export class HttpThread {
|
|
|
48
48
|
return this;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
async get(key, filter = null) {
|
|
52
|
+
const thread = await this.#store.get(this.#threadID) || {};
|
|
53
|
+
const values = [].concat(thread[key] ?? []);
|
|
54
|
+
|
|
55
|
+
let value;
|
|
56
|
+
if (filter === true) {
|
|
57
|
+
value = values;
|
|
58
|
+
} else if (filter) {
|
|
59
|
+
value = values.find(filter);
|
|
60
|
+
} else { value = values[values.length - 1]; }
|
|
61
|
+
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
|
|
51
65
|
async consume(key, filter = null) {
|
|
52
66
|
const thread = await this.#store.get(this.#threadID) || {};
|
|
53
67
|
const values = [].concat(thread[key] ?? []);
|
|
@@ -505,7 +505,7 @@ export class WebfloServer extends WebfloRuntime {
|
|
|
505
505
|
const matchRoot = path => sparoots.reduce((prev, root) => prev || (`${path}/`.startsWith(`${root}/`) && root), null);
|
|
506
506
|
isSameSpaRedirect = matchRoot(destinationURL.pathname) === matchRoot(httpEvent.url.pathname);
|
|
507
507
|
}
|
|
508
|
-
if (xRedirectPolicy === 'manual' || (!isSameOriginRedirect && xRedirectPolicy === 'manual-when-cross-origin') || (!isSameSpaRedirect && xRedirectPolicy === 'manual-when-cross-spa')) {
|
|
508
|
+
if (xRedirectPolicy === 'manual' || (!isSameOriginRedirect && (xRedirectPolicy === 'manual-when-cross-origin' || xRedirectPolicy === 'manual-when-cross-spa')) || (!isSameSpaRedirect && xRedirectPolicy === 'manual-when-cross-spa')) {
|
|
509
509
|
response.headers.set('X-Redirect-Code', responseShim.prototype.status.get.call(response));
|
|
510
510
|
response.headers.set('Access-Control-Allow-Origin', '*');
|
|
511
511
|
response.headers.set('Cache-Control', 'no-store');
|