@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
|
@@ -50,11 +50,9 @@ function parseTraceparent(value) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
function randomHex(bytes) {
|
|
53
|
-
const buffer = new Uint8Array(bytes);
|
|
54
|
-
crypto.getRandomValues(buffer);
|
|
55
53
|
let out = "";
|
|
56
|
-
for (let i = 0; i <
|
|
57
|
-
return out;
|
|
54
|
+
for (let i = 0; i < bytes; i += 4) out += (Math.random() * 0x100000000 >>> 0).toString(16).padStart(8, "0");
|
|
55
|
+
return out.length === bytes * 2 ? out : out.slice(0, bytes * 2);
|
|
58
56
|
}
|
|
59
57
|
function randomTraceId() {
|
|
60
58
|
let id = randomHex(16);
|
|
@@ -802,6 +800,10 @@ function createEventChunk(data, id) {
|
|
|
802
800
|
return CHUNK_ENCODER.encode(event + "\n");
|
|
803
801
|
}
|
|
804
802
|
const EVENT_STREAM_HEARTBEAT = /* @__PURE__ */new TextEncoder().encode(":\n\n");
|
|
803
|
+
function isEventStream(source) {
|
|
804
|
+
const contentType = source.headers.get("content-type");
|
|
805
|
+
return !!contentType && contentType.startsWith("text/event-stream");
|
|
806
|
+
}
|
|
805
807
|
function positionDigest(value) {
|
|
806
808
|
if (value === undefined || !isJSONSafe(value)) return undefined;
|
|
807
809
|
const text = JSON.stringify(value);
|
|
@@ -864,7 +866,7 @@ async function deserializeStream(source, codecOptions, wire) {
|
|
|
864
866
|
if (!source.body) {
|
|
865
867
|
throw new Error("missing body");
|
|
866
868
|
}
|
|
867
|
-
const reader = new ChunkReader(source.body);
|
|
869
|
+
const reader = wire && isEventStream(source) ? wire.open(source.body) : new ChunkReader(source.body);
|
|
868
870
|
try {
|
|
869
871
|
const result = await reader.next();
|
|
870
872
|
if (!result.done) {
|
|
@@ -883,10 +885,18 @@ async function deserializeStream(source, codecOptions, wire) {
|
|
|
883
885
|
}
|
|
884
886
|
const connection = wire && wire.connection;
|
|
885
887
|
let endConnection;
|
|
886
|
-
if (connection) ;
|
|
888
|
+
if (connection) connection.ended = new Promise(resolve => endConnection = resolve);
|
|
887
889
|
const end = error => {
|
|
888
890
|
const sweep = () => deserializeChunk.abort(error);
|
|
889
|
-
if (connection)
|
|
891
|
+
if (connection) {
|
|
892
|
+
const close = () => deserializeChunk.close();
|
|
893
|
+
endConnection({
|
|
894
|
+
open: deserializeChunk.open(),
|
|
895
|
+
error,
|
|
896
|
+
sweep,
|
|
897
|
+
close
|
|
898
|
+
});
|
|
899
|
+
} else sweep();
|
|
890
900
|
};
|
|
891
901
|
reader.drain(interpretChunk).then(() => end(new Error("Server function stream ended unexpectedly.")), error => end(error));
|
|
892
902
|
return interpretChunk(result.value);
|
|
@@ -896,9 +906,6 @@ async function deserializeStream(source, codecOptions, wire) {
|
|
|
896
906
|
throw error;
|
|
897
907
|
}
|
|
898
908
|
}
|
|
899
|
-
async function deserializeString(text, codecOptions) {
|
|
900
|
-
return await deserializeStream(new Response(text), codecOptions);
|
|
901
|
-
}
|
|
902
909
|
async function decodeResponse(response, codecOptions) {
|
|
903
910
|
if (!response.body) return undefined;
|
|
904
911
|
return await extractBody(response.clone(), codecOptions === undefined ? codecConfig.codec : codecOptions);
|
|
@@ -1186,6 +1193,96 @@ async function decodeFlashCookie(cookieHeader) {
|
|
|
1186
1193
|
}
|
|
1187
1194
|
}
|
|
1188
1195
|
|
|
1196
|
+
const RESPONSE_TAG = "seroval-plugins/web/Response";
|
|
1197
|
+
const REQUEST_TAG = "seroval-plugins/web/Request";
|
|
1198
|
+
const REFUSED_TAGS = [RESPONSE_TAG, REQUEST_TAG];
|
|
1199
|
+
const RESOLVED_PLUGINS = Symbol.for("solid.codec.resolvedPlugins");
|
|
1200
|
+
const REFUSED_ARGUMENT = Symbol("solid.serverFunction.refusedArgument");
|
|
1201
|
+
function refusedArgumentError(name = "Response or Request") {
|
|
1202
|
+
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.");
|
|
1203
|
+
error[REFUSED_ARGUMENT] = true;
|
|
1204
|
+
return error;
|
|
1205
|
+
}
|
|
1206
|
+
function refusedArgument(error) {
|
|
1207
|
+
for (let depth = 0; depth < 4 && error !== null && typeof error === "object"; depth++) {
|
|
1208
|
+
if (error[REFUSED_ARGUMENT] === true) return error;
|
|
1209
|
+
error = error.cause;
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
const refused = plugin => REFUSED_TAGS.includes(plugin.tag);
|
|
1213
|
+
const reachesRefused = plugin => refused(plugin) || !!plugin.extends && plugin.extends.some(reachesRefused);
|
|
1214
|
+
function filterPlugins(plugins, out, seen) {
|
|
1215
|
+
for (const plugin of plugins) {
|
|
1216
|
+
if (seen.has(plugin)) continue;
|
|
1217
|
+
seen.add(plugin);
|
|
1218
|
+
if (refused(plugin)) continue;
|
|
1219
|
+
const severs = !!plugin.extends && plugin.extends.some(reachesRefused);
|
|
1220
|
+
out.push(severs ? {
|
|
1221
|
+
...plugin,
|
|
1222
|
+
extends: undefined
|
|
1223
|
+
} : plugin);
|
|
1224
|
+
if (plugin.extends) filterPlugins(plugin.extends, out, seen);
|
|
1225
|
+
}
|
|
1226
|
+
return out;
|
|
1227
|
+
}
|
|
1228
|
+
let defaultArgumentPlugins;
|
|
1229
|
+
const customArgumentPlugins = new WeakMap();
|
|
1230
|
+
function argumentDecodeCodec(codec, defaults) {
|
|
1231
|
+
const custom = codec && codec.plugins;
|
|
1232
|
+
let plugins = custom ? customArgumentPlugins.get(custom) : defaultArgumentPlugins;
|
|
1233
|
+
if (!plugins) {
|
|
1234
|
+
plugins = filterPlugins(custom ? [...custom, ...defaults] : defaults, [], new Set());
|
|
1235
|
+
if (custom) customArgumentPlugins.set(custom, plugins);else defaultArgumentPlugins = plugins;
|
|
1236
|
+
}
|
|
1237
|
+
return {
|
|
1238
|
+
...codec,
|
|
1239
|
+
[RESOLVED_PLUGINS]: plugins
|
|
1240
|
+
};
|
|
1241
|
+
}
|
|
1242
|
+
function namesRefusedType(payload) {
|
|
1243
|
+
for (const tag of REFUSED_TAGS) if (payload.includes(`"c":"${tag}"`)) return true;
|
|
1244
|
+
return false;
|
|
1245
|
+
}
|
|
1246
|
+
function withArgumentPlugins(argumentCodec, extra) {
|
|
1247
|
+
return {
|
|
1248
|
+
...argumentCodec,
|
|
1249
|
+
[RESOLVED_PLUGINS]: [...extra, ...argumentCodec[RESOLVED_PLUGINS]]
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
const UPLOAD_ARGS_PART = "args";
|
|
1254
|
+
const UPLOAD_FILE_PART = "file";
|
|
1255
|
+
const UPLOAD_TAG = "solid/server-function-upload";
|
|
1256
|
+
function isBlob(value) {
|
|
1257
|
+
if (typeof Blob !== "undefined" && value instanceof Blob) return true;
|
|
1258
|
+
return typeof value === "object" && value !== null && typeof value.size === "number" && typeof value.type === "string" && typeof value.arrayBuffer === "function" && typeof value.slice === "function";
|
|
1259
|
+
}
|
|
1260
|
+
function malformed() {
|
|
1261
|
+
return new TypeError("Malformed server function upload");
|
|
1262
|
+
}
|
|
1263
|
+
function createUploadDeserializer(form) {
|
|
1264
|
+
const refuse = () => {
|
|
1265
|
+
throw malformed();
|
|
1266
|
+
};
|
|
1267
|
+
return {
|
|
1268
|
+
tag: UPLOAD_TAG,
|
|
1269
|
+
test: () => false,
|
|
1270
|
+
parse: {
|
|
1271
|
+
sync: refuse,
|
|
1272
|
+
async: refuse,
|
|
1273
|
+
stream: refuse
|
|
1274
|
+
},
|
|
1275
|
+
serialize: refuse,
|
|
1276
|
+
deserialize: (node, ctx) => {
|
|
1277
|
+
const index = ctx.deserialize(node.i);
|
|
1278
|
+
if (typeof index !== "number" || !Number.isSafeInteger(index) || index < 0) refuse();
|
|
1279
|
+
const part = form.get(UPLOAD_FILE_PART + index);
|
|
1280
|
+
if (!isBlob(part)) refuse();
|
|
1281
|
+
return part;
|
|
1282
|
+
}
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1189
1286
|
const config = {
|
|
1190
1287
|
provideEvent: undefined,
|
|
1191
1288
|
wrapInvocation: undefined,
|
|
@@ -1627,6 +1724,7 @@ function live(fn) {
|
|
|
1627
1724
|
if (!isServerFunction(fn) || typeof fn.id !== "string") {
|
|
1628
1725
|
throw new Error("live expects a server function reference");
|
|
1629
1726
|
}
|
|
1727
|
+
if (getServerFunctionMetadata(fn)?.method !== "GET") fn = GET(fn);
|
|
1630
1728
|
const metadata = {
|
|
1631
1729
|
...getServerFunctionMetadata(fn),
|
|
1632
1730
|
live: true
|
|
@@ -1641,6 +1739,18 @@ function live(fn) {
|
|
|
1641
1739
|
});
|
|
1642
1740
|
return wrapped;
|
|
1643
1741
|
}
|
|
1742
|
+
function broadcast(fn) {
|
|
1743
|
+
const ref = live(fn);
|
|
1744
|
+
ref[SERVER_FUNCTION_METADATA].broadcast = true;
|
|
1745
|
+
BROADCASTS.add(fn.id);
|
|
1746
|
+
return ref;
|
|
1747
|
+
}
|
|
1748
|
+
function encodedArguments(request, argsEncoding, argumentBytes) {
|
|
1749
|
+
if (request.method !== "POST") return argsEncoding || "";
|
|
1750
|
+
if (!argumentBytes) return undefined;
|
|
1751
|
+
return (request.headers.get("content-type") || "") + "\0" + (argsEncoding || "") + "\0" + new TextDecoder("latin1").decode(argumentBytes);
|
|
1752
|
+
}
|
|
1753
|
+
const BROADCASTS = new Set();
|
|
1644
1754
|
function brandLive(answer) {
|
|
1645
1755
|
if (typeof answer === "function" || answer !== null && typeof answer === "object" && answer[Symbol.asyncIterator]) {
|
|
1646
1756
|
answer[LIVE_SOURCE] = true;
|
|
@@ -1751,14 +1861,49 @@ function unknownFormatError(tag) {
|
|
|
1751
1861
|
error[FORMAT_SKEW] = true;
|
|
1752
1862
|
return error;
|
|
1753
1863
|
}
|
|
1754
|
-
async function
|
|
1864
|
+
async function decodeArguments(decode, payload) {
|
|
1865
|
+
if (payload === null) return await decode(undefined);
|
|
1866
|
+
const refuseNamed = () => {
|
|
1867
|
+
const text = typeof payload === "string" ? payload : new TextDecoder().decode(payload);
|
|
1868
|
+
if (namesRefusedType(text)) throw refusedArgumentError();
|
|
1869
|
+
};
|
|
1870
|
+
const connection = {};
|
|
1871
|
+
let value;
|
|
1872
|
+
try {
|
|
1873
|
+
value = await decode({
|
|
1874
|
+
connection
|
|
1875
|
+
});
|
|
1876
|
+
} catch (error) {
|
|
1877
|
+
if (connection.ended) connection.ended.then(end => end.sweep());
|
|
1878
|
+
refuseNamed();
|
|
1879
|
+
throw error;
|
|
1880
|
+
}
|
|
1881
|
+
if (connection.ended) {
|
|
1882
|
+
const {
|
|
1883
|
+
open,
|
|
1884
|
+
sweep
|
|
1885
|
+
} = await connection.ended;
|
|
1886
|
+
sweep();
|
|
1887
|
+
if (open) refuseNamed();
|
|
1888
|
+
}
|
|
1889
|
+
return value;
|
|
1890
|
+
}
|
|
1891
|
+
let decodeModule;
|
|
1892
|
+
async function loadArgumentCodec(codec) {
|
|
1893
|
+
decodeModule = await import('@solidjs/web/serialization/decode');
|
|
1894
|
+
return argumentDecodeCodec(codec, decodeModule.DEFAULT_WEB_PLUGINS);
|
|
1895
|
+
}
|
|
1896
|
+
const argumentCodecFor = codec => decodeModule ? argumentDecodeCodec(codec, decodeModule.DEFAULT_WEB_PLUGINS) : loadArgumentCodec(codec);
|
|
1897
|
+
async function parseArguments(request, url, scripted, codec, buffered) {
|
|
1755
1898
|
const parsed = [];
|
|
1756
1899
|
const bodyFormat = request.method === "POST" ? request.headers.get(BODY_FORMAT_HEADER) : null;
|
|
1757
1900
|
const args = url.searchParams.get("args");
|
|
1758
1901
|
if (args && (!scripted || request.method === "GET" || bodyFormat !== BodyFormat.Serialized)) {
|
|
1759
1902
|
let result;
|
|
1760
1903
|
if (args.startsWith(";0x")) {
|
|
1761
|
-
|
|
1904
|
+
let argumentCodec = argumentCodecFor(codec);
|
|
1905
|
+
if (argumentCodec instanceof Promise) argumentCodec = await argumentCodec;
|
|
1906
|
+
result = await decodeArguments(wire => deserializeStream(new Response(args), argumentCodec, wire), args);
|
|
1762
1907
|
} else {
|
|
1763
1908
|
result = JSON.parse(args);
|
|
1764
1909
|
assertDecodeDepth(result);
|
|
@@ -1778,7 +1923,24 @@ async function parseArguments(request, url, scripted, codec) {
|
|
|
1778
1923
|
throw unknownFormatError(bodyFormat);
|
|
1779
1924
|
}
|
|
1780
1925
|
const body = request.clone();
|
|
1781
|
-
|
|
1926
|
+
let decoded;
|
|
1927
|
+
if (bodyFormat === BodyFormat.Serialized) {
|
|
1928
|
+
let argumentCodec = argumentCodecFor(codec);
|
|
1929
|
+
if (argumentCodec instanceof Promise) argumentCodec = await argumentCodec;
|
|
1930
|
+
if ((request.headers.get("content-type") || "").startsWith("multipart/form-data")) {
|
|
1931
|
+
const form = await body.formData();
|
|
1932
|
+
const encoded = form.get(UPLOAD_ARGS_PART);
|
|
1933
|
+
if (typeof encoded !== "string") {
|
|
1934
|
+
throw new TypeError("Malformed server function upload");
|
|
1935
|
+
}
|
|
1936
|
+
const uploadCodec = withArgumentPlugins(argumentCodec, [createUploadDeserializer(form)]);
|
|
1937
|
+
decoded = await decodeArguments(wire => deserializeStream(new Response(encoded), uploadCodec, wire), encoded);
|
|
1938
|
+
} else {
|
|
1939
|
+
decoded = await decodeArguments(wire => extractBody(body, argumentCodec, wire), buffered);
|
|
1940
|
+
}
|
|
1941
|
+
} else {
|
|
1942
|
+
decoded = await extractBody(body, codec);
|
|
1943
|
+
}
|
|
1782
1944
|
if (bodyFormat === BodyFormat.Serialized || bodyFormat === BodyFormat.Json) {
|
|
1783
1945
|
if (bodyFormat === BodyFormat.Json) assertDecodeDepth(decoded);
|
|
1784
1946
|
if (!Array.isArray(decoded)) {
|
|
@@ -2759,6 +2921,7 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2759
2921
|
});
|
|
2760
2922
|
return finish(protectsRequest ? withCSRFVary(response) : response);
|
|
2761
2923
|
}
|
|
2924
|
+
let argumentBytes = null;
|
|
2762
2925
|
if (method === "POST" && request.body !== null && bodySizeLimit !== Infinity) {
|
|
2763
2926
|
const raw = request.headers.get("content-length");
|
|
2764
2927
|
const declared = raw !== null && /^\d+$/.test(raw) ? Number(raw) : NaN;
|
|
@@ -2784,6 +2947,7 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2784
2947
|
return finish(protectsRequest ? withCSRFVary(response) : response);
|
|
2785
2948
|
}
|
|
2786
2949
|
request = withBufferedBody(request, buffered);
|
|
2950
|
+
argumentBytes = buffered;
|
|
2787
2951
|
}
|
|
2788
2952
|
let event;
|
|
2789
2953
|
try {
|
|
@@ -2840,10 +3004,10 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2840
3004
|
const collectsFlight = flightHooks.length > 0;
|
|
2841
3005
|
let parsed;
|
|
2842
3006
|
try {
|
|
2843
|
-
parsed = await parseArguments(request, url, scripted, codec);
|
|
3007
|
+
parsed = await parseArguments(request, url, scripted, codec, argumentBytes);
|
|
2844
3008
|
} catch (error) {
|
|
2845
|
-
const
|
|
2846
|
-
const response = new Response(DEV ?
|
|
3009
|
+
const named = error !== null && typeof error === "object" && error[FORMAT_SKEW] === true ? error : refusedArgument(error);
|
|
3010
|
+
const response = new Response(DEV ? named ? named.message : "Malformed server function arguments" : null, {
|
|
2847
3011
|
status: 400
|
|
2848
3012
|
});
|
|
2849
3013
|
return refuseCommitted(response);
|
|
@@ -2867,9 +3031,12 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2867
3031
|
const dispatch = async () => {
|
|
2868
3032
|
try {
|
|
2869
3033
|
const invokeOnce = async () => {
|
|
3034
|
+
const shared = !!live && BROADCASTS.has(functionId);
|
|
2870
3035
|
INVOCATIONS.set(event, {
|
|
2871
3036
|
id: functionId,
|
|
2872
|
-
live: !!live
|
|
3037
|
+
live: !!live,
|
|
3038
|
+
broadcast: shared || undefined,
|
|
3039
|
+
shareKey: shared ? encodedArguments(request, argsEncoding, argumentBytes) : undefined
|
|
2873
3040
|
});
|
|
2874
3041
|
const run = () => serverFunction(...parsed);
|
|
2875
3042
|
return observeInvocation({
|
|
@@ -2897,7 +3064,7 @@ async function handleServerFunctionRequest(request, options = {}) {
|
|
|
2897
3064
|
response,
|
|
2898
3065
|
value
|
|
2899
3066
|
} = result;
|
|
2900
|
-
if (!scripted && !handleNoJS && response && response.body) {
|
|
3067
|
+
if (!scripted && !handleNoJS && response && response.body && isJSONSafe(value)) {
|
|
2901
3068
|
return response;
|
|
2902
3069
|
}
|
|
2903
3070
|
if (response && response.headers) {
|
|
@@ -3086,11 +3253,15 @@ function ownResponse(response) {
|
|
|
3086
3253
|
function finalizeTransportResponse(response, method) {
|
|
3087
3254
|
const stripBody = method === "HEAD" && response.body !== null;
|
|
3088
3255
|
const defaultsCache = !response.headers.has("Cache-Control") && response.status !== 304;
|
|
3089
|
-
|
|
3256
|
+
const defaultsSniff = !response.headers.has("X-Content-Type-Options");
|
|
3257
|
+
if (stripBody || defaultsCache || defaultsSniff) {
|
|
3090
3258
|
try {
|
|
3091
3259
|
if (defaultsCache) {
|
|
3092
3260
|
response.headers.set("Cache-Control", "no-store");
|
|
3093
3261
|
}
|
|
3262
|
+
if (defaultsSniff) {
|
|
3263
|
+
response.headers.set("X-Content-Type-Options", "nosniff");
|
|
3264
|
+
}
|
|
3094
3265
|
if (!stripBody) return response;
|
|
3095
3266
|
response.body.cancel().catch(() => {});
|
|
3096
3267
|
return new Response(null, {
|
|
@@ -3101,6 +3272,9 @@ function finalizeTransportResponse(response, method) {
|
|
|
3101
3272
|
} catch {
|
|
3102
3273
|
const headers = new Headers(response.headers);
|
|
3103
3274
|
if (defaultsCache && !headers.has("Cache-Control")) headers.set("Cache-Control", "no-store");
|
|
3275
|
+
if (defaultsSniff && !headers.has("X-Content-Type-Options")) {
|
|
3276
|
+
headers.set("X-Content-Type-Options", "nosniff");
|
|
3277
|
+
}
|
|
3104
3278
|
if (stripBody) response.body.cancel().catch(() => {});
|
|
3105
3279
|
return new Response(stripBody ? null : response.body, {
|
|
3106
3280
|
status: response.status,
|
|
@@ -3112,4 +3286,4 @@ function finalizeTransportResponse(response, method) {
|
|
|
3112
3286
|
return response;
|
|
3113
3287
|
}
|
|
3114
3288
|
|
|
3115
|
-
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 };
|
|
3289
|
+
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 };
|