@solidjs/web 2.0.0-rc.15 → 2.0.0-rc.17
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/README.md +1 -1
- package/dist/server.dev.js +361 -483
- package/dist/server.js +346 -391
- package/dist/server.observe.js +346 -391
- package/dist/web.dev.js +110 -55
- package/dist/web.js +51 -50
- package/dist/web.observe.js +61 -55
- package/frames/dist/client.dev.js +610 -621
- package/frames/dist/client.js +540 -566
- package/frames/dist/client.observe.js +571 -573
- package/frames/dist/regions.js +43 -2
- package/frames/dist/server.dev.js +793 -424
- package/frames/dist/server.js +792 -371
- package/frames/dist/server.observe.js +792 -371
- package/frames/dist/wire.js +371 -6
- package/package.json +11 -11
- package/serialization/dist/decode.js +9 -7
- package/serialization/dist/serialization.js +9 -7
- package/serialization/types/serializer-decode.d.ts +2 -2
- package/server-functions/dist/client.dev.js +13 -22
- package/server-functions/dist/client.js +11 -22
- package/server-functions/dist/client.observe.js +13 -22
- package/server-functions/dist/rich-args.js +84 -1
- package/server-functions/dist/server.dev.js +194 -20
- package/server-functions/dist/server.js +194 -20
- package/server-functions/dist/server.observe.js +194 -20
- package/skills/server-components/SKILL.md +74 -185
- package/types/client.d.ts +27 -5
- package/types/diagnostics.d.ts +16 -0
- package/types/frames/assets-tier.d.ts +2 -2
- package/types/frames/client.d.ts +8 -3
- package/types/frames/frame-client.d.ts +121 -157
- package/types/frames/frame-morph.d.ts +28 -0
- package/types/frames/frame-sink.d.ts +13 -9
- package/types/frames/frame-transport.d.ts +30 -1
- package/types/frames/regions-tier.d.ts +15 -0
- package/types/frames/serializer-decode.d.ts +2 -2
- package/types/frames/server.d.ts +0 -52
- package/types/frames/wire-tier.d.ts +54 -1
- package/types/index.d.ts +2 -2
- package/types/jsx.d.ts +11 -5
- package/types/observe.d.ts +14 -7
- package/types/render.d.ts +3 -1
- package/types/response.d.ts +5 -4
- package/types/serializer-decode.d.ts +2 -2
- package/types/server-functions/argument-codec.d.ts +30 -0
- package/types/server-functions/client.d.ts +27 -9
- package/types/server-functions/server.d.ts +23 -2
- package/types/server-functions/shared.d.ts +19 -0
- package/types/server-functions/uploads.d.ts +50 -0
- package/types/server-observe.d.ts +3 -2
- package/types/server.d.ts +58 -77
- package/frames/dist/bind.dev.js +0 -326
- package/frames/dist/bind.js +0 -295
- package/types/frames/bind-tier.d.ts +0 -60
|
@@ -56,11 +56,9 @@ function parseTraceparent(value) {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
function randomHex(bytes) {
|
|
59
|
-
const buffer = new Uint8Array(bytes);
|
|
60
|
-
crypto.getRandomValues(buffer);
|
|
61
59
|
let out = "";
|
|
62
|
-
for (let i = 0; i <
|
|
63
|
-
return out;
|
|
60
|
+
for (let i = 0; i < bytes; i += 4) out += (Math.random() * 0x100000000 >>> 0).toString(16).padStart(8, "0");
|
|
61
|
+
return out.length === bytes * 2 ? out : out.slice(0, bytes * 2);
|
|
64
62
|
}
|
|
65
63
|
function randomTraceId() {
|
|
66
64
|
let id = randomHex(16);
|
|
@@ -832,6 +830,10 @@ function createEventChunk(data, id) {
|
|
|
832
830
|
return CHUNK_ENCODER.encode(event + "\n");
|
|
833
831
|
}
|
|
834
832
|
const EVENT_STREAM_HEARTBEAT = /* @__PURE__ */new TextEncoder().encode(":\n\n");
|
|
833
|
+
function isEventStream(source) {
|
|
834
|
+
const contentType = source.headers.get("content-type");
|
|
835
|
+
return !!contentType && contentType.startsWith("text/event-stream");
|
|
836
|
+
}
|
|
835
837
|
function positionDigest(value) {
|
|
836
838
|
if (value === undefined || !isJSONSafe(value)) return undefined;
|
|
837
839
|
const text = JSON.stringify(value);
|
|
@@ -894,7 +896,7 @@ async function deserializeStream(source, codecOptions, wire) {
|
|
|
894
896
|
if (!source.body) {
|
|
895
897
|
throw new Error("missing body");
|
|
896
898
|
}
|
|
897
|
-
const reader = new ChunkReader(source.body);
|
|
899
|
+
const reader = wire && isEventStream(source) ? wire.open(source.body) : new ChunkReader(source.body);
|
|
898
900
|
try {
|
|
899
901
|
const result = await reader.next();
|
|
900
902
|
if (!result.done) {
|
|
@@ -913,10 +915,18 @@ async function deserializeStream(source, codecOptions, wire) {
|
|
|
913
915
|
}
|
|
914
916
|
const connection = wire && wire.connection;
|
|
915
917
|
let endConnection;
|
|
916
|
-
if (connection) ;
|
|
918
|
+
if (connection) connection.ended = new Promise(resolve => endConnection = resolve);
|
|
917
919
|
const end = error => {
|
|
918
920
|
const sweep = () => deserializeChunk.abort(error);
|
|
919
|
-
if (connection)
|
|
921
|
+
if (connection) {
|
|
922
|
+
const close = () => deserializeChunk.close();
|
|
923
|
+
endConnection({
|
|
924
|
+
open: deserializeChunk.open(),
|
|
925
|
+
error,
|
|
926
|
+
sweep,
|
|
927
|
+
close
|
|
928
|
+
});
|
|
929
|
+
} else sweep();
|
|
920
930
|
};
|
|
921
931
|
reader.drain(interpretChunk).then(() => end(new Error("Server function stream ended unexpectedly.")), error => end(error));
|
|
922
932
|
return interpretChunk(result.value);
|
|
@@ -926,9 +936,6 @@ async function deserializeStream(source, codecOptions, wire) {
|
|
|
926
936
|
throw error;
|
|
927
937
|
}
|
|
928
938
|
}
|
|
929
|
-
async function deserializeString(text, codecOptions) {
|
|
930
|
-
return await deserializeStream(new Response(text), codecOptions);
|
|
931
|
-
}
|
|
932
939
|
async function decodeResponse(response, codecOptions) {
|
|
933
940
|
if (!response.body) return undefined;
|
|
934
941
|
return await extractBody(response.clone(), codecOptions === undefined ? codecConfig.codec : codecOptions);
|
|
@@ -1238,6 +1245,96 @@ async function decodeFlashCookie(cookieHeader) {
|
|
|
1238
1245
|
}
|
|
1239
1246
|
}
|
|
1240
1247
|
|
|
1248
|
+
const RESPONSE_TAG = "seroval-plugins/web/Response";
|
|
1249
|
+
const REQUEST_TAG = "seroval-plugins/web/Request";
|
|
1250
|
+
const REFUSED_TAGS = [RESPONSE_TAG, REQUEST_TAG];
|
|
1251
|
+
const RESOLVED_PLUGINS = Symbol.for("solid.codec.resolvedPlugins");
|
|
1252
|
+
const REFUSED_ARGUMENT = Symbol("solid.serverFunction.refusedArgument");
|
|
1253
|
+
function refusedArgumentError(name = "Response or Request") {
|
|
1254
|
+
const error = new TypeError(`Server function arguments cannot carry Response or Request values (got a ${name}). ` + "Pass the data it holds — its body, headers or url — instead.");
|
|
1255
|
+
error[REFUSED_ARGUMENT] = true;
|
|
1256
|
+
return error;
|
|
1257
|
+
}
|
|
1258
|
+
function refusedArgument(error) {
|
|
1259
|
+
for (let depth = 0; depth < 4 && error !== null && typeof error === "object"; depth++) {
|
|
1260
|
+
if (error[REFUSED_ARGUMENT] === true) return error;
|
|
1261
|
+
error = error.cause;
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
const refused = plugin => REFUSED_TAGS.includes(plugin.tag);
|
|
1265
|
+
const reachesRefused = plugin => refused(plugin) || !!plugin.extends && plugin.extends.some(reachesRefused);
|
|
1266
|
+
function filterPlugins(plugins, out, seen) {
|
|
1267
|
+
for (const plugin of plugins) {
|
|
1268
|
+
if (seen.has(plugin)) continue;
|
|
1269
|
+
seen.add(plugin);
|
|
1270
|
+
if (refused(plugin)) continue;
|
|
1271
|
+
const severs = !!plugin.extends && plugin.extends.some(reachesRefused);
|
|
1272
|
+
out.push(severs ? {
|
|
1273
|
+
...plugin,
|
|
1274
|
+
extends: undefined
|
|
1275
|
+
} : plugin);
|
|
1276
|
+
if (plugin.extends) filterPlugins(plugin.extends, out, seen);
|
|
1277
|
+
}
|
|
1278
|
+
return out;
|
|
1279
|
+
}
|
|
1280
|
+
let defaultArgumentPlugins;
|
|
1281
|
+
const customArgumentPlugins = new WeakMap();
|
|
1282
|
+
function argumentDecodeCodec(codec, defaults) {
|
|
1283
|
+
const custom = codec && codec.plugins;
|
|
1284
|
+
let plugins = custom ? customArgumentPlugins.get(custom) : defaultArgumentPlugins;
|
|
1285
|
+
if (!plugins) {
|
|
1286
|
+
plugins = filterPlugins(custom ? [...custom, ...defaults] : defaults, [], new Set());
|
|
1287
|
+
if (custom) customArgumentPlugins.set(custom, plugins);else defaultArgumentPlugins = plugins;
|
|
1288
|
+
}
|
|
1289
|
+
return {
|
|
1290
|
+
...codec,
|
|
1291
|
+
[RESOLVED_PLUGINS]: plugins
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1294
|
+
function namesRefusedType(payload) {
|
|
1295
|
+
for (const tag of REFUSED_TAGS) if (payload.includes(`"c":"${tag}"`)) return true;
|
|
1296
|
+
return false;
|
|
1297
|
+
}
|
|
1298
|
+
function withArgumentPlugins(argumentCodec, extra) {
|
|
1299
|
+
return {
|
|
1300
|
+
...argumentCodec,
|
|
1301
|
+
[RESOLVED_PLUGINS]: [...extra, ...argumentCodec[RESOLVED_PLUGINS]]
|
|
1302
|
+
};
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
const UPLOAD_ARGS_PART = "args";
|
|
1306
|
+
const UPLOAD_FILE_PART = "file";
|
|
1307
|
+
const UPLOAD_TAG = "solid/server-function-upload";
|
|
1308
|
+
function isBlob(value) {
|
|
1309
|
+
if (typeof Blob !== "undefined" && value instanceof Blob) return true;
|
|
1310
|
+
return typeof value === "object" && value !== null && typeof value.size === "number" && typeof value.type === "string" && typeof value.arrayBuffer === "function" && typeof value.slice === "function";
|
|
1311
|
+
}
|
|
1312
|
+
function malformed() {
|
|
1313
|
+
return new TypeError("Malformed server function upload");
|
|
1314
|
+
}
|
|
1315
|
+
function createUploadDeserializer(form) {
|
|
1316
|
+
const refuse = () => {
|
|
1317
|
+
throw malformed();
|
|
1318
|
+
};
|
|
1319
|
+
return {
|
|
1320
|
+
tag: UPLOAD_TAG,
|
|
1321
|
+
test: () => false,
|
|
1322
|
+
parse: {
|
|
1323
|
+
sync: refuse,
|
|
1324
|
+
async: refuse,
|
|
1325
|
+
stream: refuse
|
|
1326
|
+
},
|
|
1327
|
+
serialize: refuse,
|
|
1328
|
+
deserialize: (node, ctx) => {
|
|
1329
|
+
const index = ctx.deserialize(node.i);
|
|
1330
|
+
if (typeof index !== "number" || !Number.isSafeInteger(index) || index < 0) refuse();
|
|
1331
|
+
const part = form.get(UPLOAD_FILE_PART + index);
|
|
1332
|
+
if (!isBlob(part)) refuse();
|
|
1333
|
+
return part;
|
|
1334
|
+
}
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1241
1338
|
const config = {
|
|
1242
1339
|
provideEvent: undefined,
|
|
1243
1340
|
wrapInvocation: undefined,
|
|
@@ -1679,6 +1776,7 @@ function live(fn) {
|
|
|
1679
1776
|
if (!isServerFunction(fn) || typeof fn.id !== "string") {
|
|
1680
1777
|
throw new Error("live expects a server function reference");
|
|
1681
1778
|
}
|
|
1779
|
+
if (getServerFunctionMetadata(fn)?.method !== "GET") fn = GET(fn);
|
|
1682
1780
|
const metadata = {
|
|
1683
1781
|
...getServerFunctionMetadata(fn),
|
|
1684
1782
|
live: true
|
|
@@ -1693,6 +1791,18 @@ function live(fn) {
|
|
|
1693
1791
|
});
|
|
1694
1792
|
return wrapped;
|
|
1695
1793
|
}
|
|
1794
|
+
function broadcast(fn) {
|
|
1795
|
+
const ref = live(fn);
|
|
1796
|
+
ref[SERVER_FUNCTION_METADATA].broadcast = true;
|
|
1797
|
+
BROADCASTS.add(fn.id);
|
|
1798
|
+
return ref;
|
|
1799
|
+
}
|
|
1800
|
+
function encodedArguments(request, argsEncoding, argumentBytes) {
|
|
1801
|
+
if (request.method !== "POST") return argsEncoding || "";
|
|
1802
|
+
if (!argumentBytes) return undefined;
|
|
1803
|
+
return (request.headers.get("content-type") || "") + "\0" + (argsEncoding || "") + "\0" + new TextDecoder("latin1").decode(argumentBytes);
|
|
1804
|
+
}
|
|
1805
|
+
const BROADCASTS = new Set();
|
|
1696
1806
|
function brandLive(answer) {
|
|
1697
1807
|
if (typeof answer === "function" || answer !== null && typeof answer === "object" && answer[Symbol.asyncIterator]) {
|
|
1698
1808
|
answer[LIVE_SOURCE] = true;
|
|
@@ -1803,14 +1913,49 @@ function unknownFormatError(tag) {
|
|
|
1803
1913
|
error[FORMAT_SKEW] = true;
|
|
1804
1914
|
return error;
|
|
1805
1915
|
}
|
|
1806
|
-
async function
|
|
1916
|
+
async function decodeArguments(decode, payload) {
|
|
1917
|
+
if (payload === null) return await decode(undefined);
|
|
1918
|
+
const refuseNamed = () => {
|
|
1919
|
+
const text = typeof payload === "string" ? payload : new TextDecoder().decode(payload);
|
|
1920
|
+
if (namesRefusedType(text)) throw refusedArgumentError();
|
|
1921
|
+
};
|
|
1922
|
+
const connection = {};
|
|
1923
|
+
let value;
|
|
1924
|
+
try {
|
|
1925
|
+
value = await decode({
|
|
1926
|
+
connection
|
|
1927
|
+
});
|
|
1928
|
+
} catch (error) {
|
|
1929
|
+
if (connection.ended) connection.ended.then(end => end.sweep());
|
|
1930
|
+
refuseNamed();
|
|
1931
|
+
throw error;
|
|
1932
|
+
}
|
|
1933
|
+
if (connection.ended) {
|
|
1934
|
+
const {
|
|
1935
|
+
open,
|
|
1936
|
+
sweep
|
|
1937
|
+
} = await connection.ended;
|
|
1938
|
+
sweep();
|
|
1939
|
+
if (open) refuseNamed();
|
|
1940
|
+
}
|
|
1941
|
+
return value;
|
|
1942
|
+
}
|
|
1943
|
+
let decodeModule;
|
|
1944
|
+
async function loadArgumentCodec(codec) {
|
|
1945
|
+
decodeModule = await import('@solidjs/web/serialization/decode');
|
|
1946
|
+
return argumentDecodeCodec(codec, decodeModule.DEFAULT_WEB_PLUGINS);
|
|
1947
|
+
}
|
|
1948
|
+
const argumentCodecFor = codec => decodeModule ? argumentDecodeCodec(codec, decodeModule.DEFAULT_WEB_PLUGINS) : loadArgumentCodec(codec);
|
|
1949
|
+
async function parseArguments(request, url, scripted, codec, buffered) {
|
|
1807
1950
|
const parsed = [];
|
|
1808
1951
|
const bodyFormat = request.method === "POST" ? request.headers.get(BODY_FORMAT_HEADER) : null;
|
|
1809
1952
|
const args = url.searchParams.get("args");
|
|
1810
1953
|
if (args && (!scripted || request.method === "GET" || bodyFormat !== BodyFormat.Serialized)) {
|
|
1811
1954
|
let result;
|
|
1812
1955
|
if (args.startsWith(";0x")) {
|
|
1813
|
-
|
|
1956
|
+
let argumentCodec = argumentCodecFor(codec);
|
|
1957
|
+
if (argumentCodec instanceof Promise) argumentCodec = await argumentCodec;
|
|
1958
|
+
result = await decodeArguments(wire => deserializeStream(new Response(args), argumentCodec, wire), args);
|
|
1814
1959
|
} else {
|
|
1815
1960
|
result = JSON.parse(args);
|
|
1816
1961
|
assertDecodeDepth(result);
|
|
@@ -1830,7 +1975,24 @@ async function parseArguments(request, url, scripted, codec) {
|
|
|
1830
1975
|
throw unknownFormatError(bodyFormat);
|
|
1831
1976
|
}
|
|
1832
1977
|
const body = request.clone();
|
|
1833
|
-
|
|
1978
|
+
let decoded;
|
|
1979
|
+
if (bodyFormat === BodyFormat.Serialized) {
|
|
1980
|
+
let argumentCodec = argumentCodecFor(codec);
|
|
1981
|
+
if (argumentCodec instanceof Promise) argumentCodec = await argumentCodec;
|
|
1982
|
+
if ((request.headers.get("content-type") || "").startsWith("multipart/form-data")) {
|
|
1983
|
+
const form = await body.formData();
|
|
1984
|
+
const encoded = form.get(UPLOAD_ARGS_PART);
|
|
1985
|
+
if (typeof encoded !== "string") {
|
|
1986
|
+
throw new TypeError("Malformed server function upload");
|
|
1987
|
+
}
|
|
1988
|
+
const uploadCodec = withArgumentPlugins(argumentCodec, [createUploadDeserializer(form)]);
|
|
1989
|
+
decoded = await decodeArguments(wire => deserializeStream(new Response(encoded), uploadCodec, wire), encoded);
|
|
1990
|
+
} else {
|
|
1991
|
+
decoded = await decodeArguments(wire => extractBody(body, argumentCodec, wire), buffered);
|
|
1992
|
+
}
|
|
1993
|
+
} else {
|
|
1994
|
+
decoded = await extractBody(body, codec);
|
|
1995
|
+
}
|
|
1834
1996
|
if (bodyFormat === BodyFormat.Serialized || bodyFormat === BodyFormat.Json) {
|
|
1835
1997
|
if (bodyFormat === BodyFormat.Json) assertDecodeDepth(decoded);
|
|
1836
1998
|
if (!Array.isArray(decoded)) {
|
|
@@ -2822,6 +2984,7 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2822
2984
|
});
|
|
2823
2985
|
return finish(protectsRequest ? withCSRFVary(response) : response);
|
|
2824
2986
|
}
|
|
2987
|
+
let argumentBytes = null;
|
|
2825
2988
|
if (method === "POST" && request.body !== null && bodySizeLimit !== Infinity) {
|
|
2826
2989
|
const raw = request.headers.get("content-length");
|
|
2827
2990
|
const declared = raw !== null && /^\d+$/.test(raw) ? Number(raw) : NaN;
|
|
@@ -2847,6 +3010,7 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2847
3010
|
return finish(protectsRequest ? withCSRFVary(response) : response);
|
|
2848
3011
|
}
|
|
2849
3012
|
request = withBufferedBody(request, buffered);
|
|
3013
|
+
argumentBytes = buffered;
|
|
2850
3014
|
}
|
|
2851
3015
|
let event;
|
|
2852
3016
|
try {
|
|
@@ -2903,10 +3067,10 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2903
3067
|
const collectsFlight = flightHooks.length > 0;
|
|
2904
3068
|
let parsed;
|
|
2905
3069
|
try {
|
|
2906
|
-
parsed = await parseArguments(request, url, scripted, codec);
|
|
3070
|
+
parsed = await parseArguments(request, url, scripted, codec, argumentBytes);
|
|
2907
3071
|
} catch (error) {
|
|
2908
|
-
const
|
|
2909
|
-
const response = new Response(DEV ?
|
|
3072
|
+
const named = error !== null && typeof error === "object" && error[FORMAT_SKEW] === true ? error : refusedArgument(error);
|
|
3073
|
+
const response = new Response(DEV ? named ? named.message : "Malformed server function arguments" : null, {
|
|
2910
3074
|
status: 400
|
|
2911
3075
|
});
|
|
2912
3076
|
return refuseCommitted(response);
|
|
@@ -2930,9 +3094,12 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2930
3094
|
const dispatch = async () => {
|
|
2931
3095
|
try {
|
|
2932
3096
|
const invokeOnce = async () => {
|
|
3097
|
+
const shared = !!live && BROADCASTS.has(functionId);
|
|
2933
3098
|
INVOCATIONS.set(event, {
|
|
2934
3099
|
id: functionId,
|
|
2935
|
-
live: !!live
|
|
3100
|
+
live: !!live,
|
|
3101
|
+
broadcast: shared || undefined,
|
|
3102
|
+
shareKey: shared ? encodedArguments(request, argsEncoding, argumentBytes) : undefined
|
|
2936
3103
|
});
|
|
2937
3104
|
const run = () => serverFunction(...parsed);
|
|
2938
3105
|
return observeInvocation({
|
|
@@ -2960,7 +3127,7 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2960
3127
|
response,
|
|
2961
3128
|
value
|
|
2962
3129
|
} = result;
|
|
2963
|
-
if (!scripted && !handleNoJS && response && response.body) {
|
|
3130
|
+
if (!scripted && !handleNoJS && response && response.body && isJSONSafe(value)) {
|
|
2964
3131
|
return response;
|
|
2965
3132
|
}
|
|
2966
3133
|
if (response && response.headers) {
|
|
@@ -3149,11 +3316,15 @@ function ownResponse(response) {
|
|
|
3149
3316
|
function finalizeTransportResponse(response, method) {
|
|
3150
3317
|
const stripBody = method === "HEAD" && response.body !== null;
|
|
3151
3318
|
const defaultsCache = !response.headers.has("Cache-Control") && response.status !== 304;
|
|
3152
|
-
|
|
3319
|
+
const defaultsSniff = !response.headers.has("X-Content-Type-Options");
|
|
3320
|
+
if (stripBody || defaultsCache || defaultsSniff) {
|
|
3153
3321
|
try {
|
|
3154
3322
|
if (defaultsCache) {
|
|
3155
3323
|
response.headers.set("Cache-Control", "no-store");
|
|
3156
3324
|
}
|
|
3325
|
+
if (defaultsSniff) {
|
|
3326
|
+
response.headers.set("X-Content-Type-Options", "nosniff");
|
|
3327
|
+
}
|
|
3157
3328
|
if (!stripBody) return response;
|
|
3158
3329
|
response.body.cancel().catch(() => {});
|
|
3159
3330
|
return new Response(null, {
|
|
@@ -3164,6 +3335,9 @@ function finalizeTransportResponse(response, method) {
|
|
|
3164
3335
|
} catch {
|
|
3165
3336
|
const headers = new Headers(response.headers);
|
|
3166
3337
|
if (defaultsCache && !headers.has("Cache-Control")) headers.set("Cache-Control", "no-store");
|
|
3338
|
+
if (defaultsSniff && !headers.has("X-Content-Type-Options")) {
|
|
3339
|
+
headers.set("X-Content-Type-Options", "nosniff");
|
|
3340
|
+
}
|
|
3167
3341
|
if (stripBody) response.body.cancel().catch(() => {});
|
|
3168
3342
|
return new Response(stripBody ? null : response.body, {
|
|
3169
3343
|
status: response.status,
|
|
@@ -3175,4 +3349,4 @@ function finalizeTransportResponse(response, method) {
|
|
|
3175
3349
|
return response;
|
|
3176
3350
|
}
|
|
3177
3351
|
|
|
3178
|
-
export { ChunkReader, ERROR_HEADER, FLASH_COOKIE, GENERIC_SERVER_ERROR_MESSAGE, GET, REDIRECT_HEADER, SERVER_FUNCTION_INVOKE, SINGLE_FLIGHT_HEADER, UNKNOWN_HEADER, armLiveBody, clearFlashCookie, configureServerFunctionsServer, createChunk, createEventChunk, createNoJSHandler, createServerReference, decodeErrorHeaderValue, decodeFlashCookie, decodeRedirectHeaderValue, decodeResponse, decodeResponsePayload, encodeErrorHeaderValue, encodeFlashCookie, foldSetCookies, frameAddress, getEventServerFunctionInvocation, getServerFunction, getServerFunctionInvocation, getServerFunctionMetadata, guardFailures, handleServerFunctionRequest, hasFlashCookie, invoke, isServerFunction, live, parseServerFunctionActionUrl, registerFlightDataSource, registerServerFunction, registerServerReference, sanitizeServerError, serializeResponseStream, serializeStream, serverFunctionActionUrl, serverFunctionUrl, setServerFunctionsDev, subscribeFlightData, textDigest, withMeta };
|
|
3352
|
+
export { ChunkReader, ERROR_HEADER, FLASH_COOKIE, GENERIC_SERVER_ERROR_MESSAGE, GET, REDIRECT_HEADER, SERVER_FUNCTION_INVOKE, SINGLE_FLIGHT_HEADER, UNKNOWN_HEADER, armLiveBody, broadcast, clearFlashCookie, configureServerFunctionsServer, createChunk, createEventChunk, createNoJSHandler, createServerReference, decodeErrorHeaderValue, decodeFlashCookie, decodeRedirectHeaderValue, decodeResponse, decodeResponsePayload, encodeErrorHeaderValue, encodeFlashCookie, foldSetCookies, frameAddress, getEventServerFunctionInvocation, getServerFunction, getServerFunctionInvocation, getServerFunctionMetadata, guardFailures, handleServerFunctionRequest, hasFlashCookie, invoke, isServerFunction, live, parseServerFunctionActionUrl, registerFlightDataSource, registerServerFunction, registerServerReference, sanitizeServerError, serializeResponseStream, serializeStream, serverFunctionActionUrl, serverFunctionUrl, setServerFunctionsDev, subscribeFlightData, textDigest, withMeta };
|