@kubohiroya/turbowarp-http-server 0.1.0 → 0.2.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.
- package/README.ja.md +29 -13
- package/README.md +101 -42
- package/dist/cli.js +131 -17
- package/dist/cli.js.map +1 -1
- package/dist/compiler/adapters/cloudflare.d.ts +2 -0
- package/dist/compiler/adapters/cloudflare.js +477 -0
- package/dist/compiler/adapters/cloudflare.js.map +1 -0
- package/dist/compiler/adapters/firebase.d.ts +2 -0
- package/dist/compiler/adapters/firebase.js +489 -0
- package/dist/compiler/adapters/firebase.js.map +1 -0
- package/dist/compiler/adapters/index.d.ts +2 -0
- package/dist/compiler/adapters/index.js +3 -0
- package/dist/compiler/adapters/index.js.map +1 -0
- package/dist/compiler/binary/codec.d.ts +4 -0
- package/dist/compiler/binary/codec.js +45 -0
- package/dist/compiler/binary/codec.js.map +1 -0
- package/dist/compiler/binary/error.d.ts +3 -0
- package/dist/compiler/binary/error.js +21 -0
- package/dist/compiler/binary/error.js.map +1 -0
- package/dist/compiler/binary/index.d.ts +4 -0
- package/dist/compiler/binary/index.js +5 -0
- package/dist/compiler/binary/index.js.map +1 -0
- package/dist/compiler/binary/runtime.d.ts +18 -0
- package/dist/compiler/binary/runtime.js +123 -0
- package/dist/compiler/binary/runtime.js.map +1 -0
- package/dist/compiler/binary/types.d.ts +17 -0
- package/dist/compiler/binary/types.js +2 -0
- package/dist/compiler/binary/types.js.map +1 -0
- package/dist/compiler/feature-flags.d.ts +4 -0
- package/dist/compiler/feature-flags.js +4 -0
- package/dist/compiler/feature-flags.js.map +1 -0
- package/dist/compiler/index.d.ts +35 -0
- package/dist/compiler/index.js +84 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/ir-v2/canonical.d.ts +3 -0
- package/dist/compiler/ir-v2/canonical.js +50 -0
- package/dist/compiler/ir-v2/canonical.js.map +1 -0
- package/dist/compiler/ir-v2/index.d.ts +4 -0
- package/dist/compiler/ir-v2/index.js +5 -0
- package/dist/compiler/ir-v2/index.js.map +1 -0
- package/dist/compiler/ir-v2/parse.d.ts +10 -0
- package/dist/compiler/ir-v2/parse.js +753 -0
- package/dist/compiler/ir-v2/parse.js.map +1 -0
- package/dist/compiler/ir-v2/strict-json.d.ts +4 -0
- package/dist/compiler/ir-v2/strict-json.js +133 -0
- package/dist/compiler/ir-v2/strict-json.js.map +1 -0
- package/dist/compiler/ir-v2/types.d.ts +412 -0
- package/dist/compiler/ir-v2/types.js +84 -0
- package/dist/compiler/ir-v2/types.js.map +1 -0
- package/dist/compiler/kvs/lowering.d.ts +13 -0
- package/dist/compiler/kvs/lowering.js +77 -0
- package/dist/compiler/kvs/lowering.js.map +1 -0
- package/dist/compiler/manifest/error.d.ts +7 -0
- package/dist/compiler/manifest/error.js +9 -0
- package/dist/compiler/manifest/error.js.map +1 -0
- package/dist/compiler/manifest/index.d.ts +6 -0
- package/dist/compiler/manifest/index.js +7 -0
- package/dist/compiler/manifest/index.js.map +1 -0
- package/dist/compiler/manifest/operations.d.ts +12 -0
- package/dist/compiler/manifest/operations.js +60 -0
- package/dist/compiler/manifest/operations.js.map +1 -0
- package/dist/compiler/manifest/parse.d.ts +9 -0
- package/dist/compiler/manifest/parse.js +280 -0
- package/dist/compiler/manifest/parse.js.map +1 -0
- package/dist/compiler/manifest/registry.d.ts +3 -0
- package/dist/compiler/manifest/registry.js +48 -0
- package/dist/compiler/manifest/registry.js.map +1 -0
- package/dist/compiler/manifest/resolve.d.ts +14 -0
- package/dist/compiler/manifest/resolve.js +116 -0
- package/dist/compiler/manifest/resolve.js.map +1 -0
- package/dist/compiler/manifest/types.d.ts +95 -0
- package/dist/compiler/manifest/types.js +3 -0
- package/dist/compiler/manifest/types.js.map +1 -0
- package/dist/compiler/named-body/index.d.ts +1 -0
- package/dist/compiler/named-body/index.js +2 -0
- package/dist/compiler/named-body/index.js.map +1 -0
- package/dist/compiler/named-body/lowering.d.ts +18 -0
- package/dist/compiler/named-body/lowering.js +83 -0
- package/dist/compiler/named-body/lowering.js.map +1 -0
- package/dist/compiler/pipeline/compiler.d.ts +18 -0
- package/dist/compiler/pipeline/compiler.js +105 -0
- package/dist/compiler/pipeline/compiler.js.map +1 -0
- package/dist/compiler/pipeline/core-generator.d.ts +3 -0
- package/dist/compiler/pipeline/core-generator.js +483 -0
- package/dist/compiler/pipeline/core-generator.js.map +1 -0
- package/dist/compiler/pipeline/index.d.ts +5 -0
- package/dist/compiler/pipeline/index.js +6 -0
- package/dist/compiler/pipeline/index.js.map +1 -0
- package/dist/compiler/pipeline/registry.d.ts +7 -0
- package/dist/compiler/pipeline/registry.js +17 -0
- package/dist/compiler/pipeline/registry.js.map +1 -0
- package/dist/compiler/pipeline/requirements.d.ts +9 -0
- package/dist/compiler/pipeline/requirements.js +135 -0
- package/dist/compiler/pipeline/requirements.js.map +1 -0
- package/dist/compiler/pipeline/types.d.ts +65 -0
- package/dist/compiler/pipeline/types.js +2 -0
- package/dist/compiler/pipeline/types.js.map +1 -0
- package/dist/compiler/runtime/error.d.ts +6 -0
- package/dist/compiler/runtime/error.js +9 -0
- package/dist/compiler/runtime/error.js.map +1 -0
- package/dist/compiler/runtime/index.d.ts +1 -0
- package/dist/compiler/runtime/index.js +2 -0
- package/dist/compiler/runtime/index.js.map +1 -0
- package/dist/compiler/structured-data/index.d.ts +3 -0
- package/dist/compiler/structured-data/index.js +4 -0
- package/dist/compiler/structured-data/index.js.map +1 -0
- package/dist/compiler/structured-data/lowering.d.ts +30 -0
- package/dist/compiler/structured-data/lowering.js +202 -0
- package/dist/compiler/structured-data/lowering.js.map +1 -0
- package/dist/compiler/structured-data/path.d.ts +2 -0
- package/dist/compiler/structured-data/path.js +60 -0
- package/dist/compiler/structured-data/path.js.map +1 -0
- package/dist/compiler/structured-data/runtime.d.ts +20 -0
- package/dist/compiler/structured-data/runtime.js +210 -0
- package/dist/compiler/structured-data/runtime.js.map +1 -0
- package/dist/compiler/turbowarp-v2.d.ts +8 -0
- package/dist/compiler/turbowarp-v2.js +479 -0
- package/dist/compiler/turbowarp-v2.js.map +1 -0
- package/dist/compiler/validator/index.d.ts +4 -0
- package/dist/compiler/validator/index.js +5 -0
- package/dist/compiler/validator/index.js.map +1 -0
- package/dist/compiler/validator/ir-validator.d.ts +10 -0
- package/dist/compiler/validator/ir-validator.js +463 -0
- package/dist/compiler/validator/ir-validator.js.map +1 -0
- package/dist/compiler/validator/resource-lifetime.d.ts +18 -0
- package/dist/compiler/validator/resource-lifetime.js +106 -0
- package/dist/compiler/validator/resource-lifetime.js.map +1 -0
- package/dist/compiler/validator/turbowarp-subset.d.ts +3 -0
- package/dist/compiler/validator/turbowarp-subset.js +241 -0
- package/dist/compiler/validator/turbowarp-subset.js.map +1 -0
- package/dist/compiler/validator/types.d.ts +30 -0
- package/dist/compiler/validator/types.js +7 -0
- package/dist/compiler/validator/types.js.map +1 -0
- package/dist/config.d.ts +11 -0
- package/dist/config.js +12 -0
- package/dist/config.js.map +1 -0
- package/dist/digest-cli.js +0 -0
- package/dist/extension-manifest.json +102 -0
- package/dist/named-body.d.ts +57 -0
- package/dist/named-body.js +396 -0
- package/dist/named-body.js.map +1 -0
- package/dist/named-data-namespace.d.ts +3 -0
- package/dist/named-data-namespace.js +6 -0
- package/dist/named-data-namespace.js.map +1 -0
- package/dist/protocol.d.ts +13 -1
- package/dist/protocol.js +34 -0
- package/dist/protocol.js.map +1 -1
- package/dist/resource-named-body-provider.d.ts +8 -0
- package/dist/resource-named-body-provider.js +88 -0
- package/dist/resource-named-body-provider.js.map +1 -0
- package/dist/server.d.ts +10 -1
- package/dist/server.js +37 -7
- package/dist/server.js.map +1 -1
- package/dist/turbowarp-http-server.js +516 -1
- package/docs/binary-resource-semantics.ja.md +84 -0
- package/docs/cloudflare-worker-compiler.ja.md +90 -0
- package/docs/compiler-manifest-registry.ja.md +79 -0
- package/docs/compiler-platform-pipeline.ja.md +94 -0
- package/docs/deploy-ir-v2.ja.md +123 -0
- package/docs/fixed-input-editors.ja.md +23 -0
- package/docs/index.html +80 -0
- package/docs/ir-v2-conformance.ja.md +65 -0
- package/docs/named-response-body.ja.md +120 -0
- package/docs/platform-storage-adapters.ja.md +99 -0
- package/docs/server-executable-subset.ja.md +88 -0
- package/docs/structured-data-lowering.ja.md +63 -0
- package/examples/compiler/message-app.v2.ir.json +41 -0
- package/package.json +44 -20
- package/schemas/block-editor-fixed-inputs.schema.json +85 -0
- package/schemas/compiler-extension-manifest.schema.json +126 -0
- package/schemas/compiler-manifest-lock-v1.schema.json +48 -0
- package/schemas/deploy-ir-v2.schema.json +835 -0
- package/schemas/ir-v2-conformance-fixture.schema.json +44 -0
- package/src/block-definitions.json +76 -0
- package/src/cli.ts +136 -23
- package/src/compiler/adapters/cloudflare.ts +510 -0
- package/src/compiler/adapters/firebase.ts +538 -0
- package/src/compiler/adapters/index.ts +2 -0
- package/src/compiler/binary/codec.ts +61 -0
- package/src/compiler/binary/error.ts +25 -0
- package/src/compiler/binary/index.ts +4 -0
- package/src/compiler/binary/runtime.ts +133 -0
- package/src/compiler/binary/types.ts +26 -0
- package/src/compiler/feature-flags.ts +7 -0
- package/src/compiler/index.ts +114 -0
- package/src/compiler/ir-v2/canonical.ts +46 -0
- package/src/compiler/ir-v2/index.ts +9 -0
- package/src/compiler/ir-v2/parse.ts +921 -0
- package/src/compiler/ir-v2/strict-json.ts +129 -0
- package/src/compiler/ir-v2/types.ts +462 -0
- package/src/compiler/kvs/lowering.ts +88 -0
- package/src/compiler/manifest/error.ts +29 -0
- package/src/compiler/manifest/index.ts +17 -0
- package/src/compiler/manifest/operations.ts +175 -0
- package/src/compiler/manifest/parse.ts +390 -0
- package/src/compiler/manifest/registry.ts +74 -0
- package/src/compiler/manifest/resolve.ts +159 -0
- package/src/compiler/manifest/types.ts +112 -0
- package/src/compiler/named-body/index.ts +1 -0
- package/src/compiler/named-body/lowering.ts +186 -0
- package/src/compiler/pipeline/compiler.ts +138 -0
- package/src/compiler/pipeline/core-generator.ts +486 -0
- package/src/compiler/pipeline/index.ts +5 -0
- package/src/compiler/pipeline/registry.ts +18 -0
- package/src/compiler/pipeline/requirements.ts +139 -0
- package/src/compiler/pipeline/types.ts +59 -0
- package/src/compiler/runtime/error.ts +11 -0
- package/src/compiler/runtime/index.ts +1 -0
- package/src/compiler/structured-data/index.ts +3 -0
- package/src/compiler/structured-data/lowering.ts +314 -0
- package/src/compiler/structured-data/path.ts +53 -0
- package/src/compiler/structured-data/runtime.ts +221 -0
- package/src/compiler/turbowarp-v2.ts +610 -0
- package/src/compiler/validator/index.ts +4 -0
- package/src/compiler/validator/ir-validator.ts +812 -0
- package/src/compiler/validator/resource-lifetime.ts +153 -0
- package/src/compiler/validator/turbowarp-subset.ts +387 -0
- package/src/compiler/validator/types.ts +68 -0
- package/src/extension.ts +87 -1
- package/src/fixed-input-editors.ts +181 -0
- package/src/fixed-input-schema.ts +15 -0
- package/src/named-body.ts +495 -0
- package/src/named-data-namespace.ts +6 -0
- package/src/protocol.ts +50 -1
- package/src/resource-named-body-provider.ts +106 -0
- package/src/server.ts +88 -8
- package/docs/turbowarp-http-server.architecture.visual-check.1440x900.dark.png +0 -0
- package/docs/turbowarp-http-server.architecture.visual-check.1440x900.light.png +0 -0
- package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.dark.png +0 -0
- package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.light.png +0 -0
- package/docs/turbowarp-http-server.architecture.visual-check.html +0 -32
- package/docs/turbowarp-http-server.architecture.visual-check.json +0 -547
- package/schemas/extension-manifest.schema.json +0 -49
- package/src/extension-manifest.ts +0 -149
package/src/server.ts
CHANGED
|
@@ -12,6 +12,8 @@ import {DIGEST_AUTH_USER_HEADER, isLocalAddress, verifyDigestAuth} from './auth/
|
|
|
12
12
|
import type {DigestAuthOptions} from './auth/digest.js';
|
|
13
13
|
import {createCommunityApp} from './community.js';
|
|
14
14
|
import type {CommunityServerOptions} from './community.js';
|
|
15
|
+
import {NamedBodyResponder, NamedBodyResolver} from './named-body.js';
|
|
16
|
+
import {createAssetManagerNamedBodyProvider} from './resource-named-body-provider.js';
|
|
15
17
|
import {
|
|
16
18
|
HTTP_BRIDGE_PROTOCOL,
|
|
17
19
|
HTTP_BRIDGE_PROTOCOL_VERSION,
|
|
@@ -25,6 +27,33 @@ import {
|
|
|
25
27
|
} from './protocol.js';
|
|
26
28
|
import type {BridgeBody, BridgeRequestMessage, BridgeResponseMessage} from './protocol.js';
|
|
27
29
|
|
|
30
|
+
export {
|
|
31
|
+
createNamedBodyResponse,
|
|
32
|
+
DEFAULT_NAMED_RESPONSE_BODY_FEATURE_FLAGS,
|
|
33
|
+
NAMED_DATA_ERROR_CODES,
|
|
34
|
+
NamedBodyResponder,
|
|
35
|
+
NamedBodyResolver,
|
|
36
|
+
NamedDataRegistryResolver
|
|
37
|
+
} from './named-body.js';
|
|
38
|
+
export type {
|
|
39
|
+
NamedBodyErrorCode,
|
|
40
|
+
NamedBodyHandle,
|
|
41
|
+
NamedBodyMetadata,
|
|
42
|
+
NamedBodyProvider,
|
|
43
|
+
NamedBodyReleaseReason,
|
|
44
|
+
NamedBodyRequest,
|
|
45
|
+
NamedBodyResponseOptions,
|
|
46
|
+
NamedBodyRepresentation,
|
|
47
|
+
NamedDataKind,
|
|
48
|
+
NamedDataContextResolver,
|
|
49
|
+
NamedDataErrorCode,
|
|
50
|
+
NamedDataReference,
|
|
51
|
+
NamedDataScope,
|
|
52
|
+
NamedResponseBodyFeatureFlags
|
|
53
|
+
} from './named-body.js';
|
|
54
|
+
export {createAssetManagerNamedBodyProvider} from './resource-named-body-provider.js';
|
|
55
|
+
export type {AssetManagerNamedBodyProviderOptions} from './resource-named-body-provider.js';
|
|
56
|
+
|
|
28
57
|
export interface ServerOptions {
|
|
29
58
|
hostname: string;
|
|
30
59
|
port: number;
|
|
@@ -36,6 +65,10 @@ export interface ServerOptions {
|
|
|
36
65
|
digestAuth?: DigestAuthOptions;
|
|
37
66
|
tls?: HttpsServerOptions;
|
|
38
67
|
requestTimeoutMs?: number;
|
|
68
|
+
namedResponseBody?: boolean;
|
|
69
|
+
/** Overrides the built-in ResourceCapability adapter for canonical named-data registries or custom providers. */
|
|
70
|
+
namedBodyResolver?: NamedBodyResolver;
|
|
71
|
+
maxNamedResponseBodyBytes?: number;
|
|
39
72
|
routes?: readonly string[];
|
|
40
73
|
community?: false | CommunityServerOptions;
|
|
41
74
|
}
|
|
@@ -132,7 +165,7 @@ const TEXT_BODY_TYPES = [
|
|
|
132
165
|
const authenticatedUsers = new WeakMap<Request, string>();
|
|
133
166
|
|
|
134
167
|
export interface HttpRequestBridge {
|
|
135
|
-
forward(message: BridgeRequestMessage, method: string): Promise<Response>;
|
|
168
|
+
forward(message: BridgeRequestMessage, method: string, signal?: AbortSignal): Promise<Response>;
|
|
136
169
|
}
|
|
137
170
|
|
|
138
171
|
export function createApp(options: ServerAppOptions = {}): Hono {
|
|
@@ -193,7 +226,8 @@ export function createApp(options: ServerAppOptions = {}): Hono {
|
|
|
193
226
|
if (authenticatedUser) bridgeRequestOptions.authenticatedUser = authenticatedUser;
|
|
194
227
|
return options.bridge.forward(
|
|
195
228
|
await createBridgeRequestMessage(c.req.raw, bridgeRequestOptions),
|
|
196
|
-
c.req.method
|
|
229
|
+
c.req.method,
|
|
230
|
+
c.req.raw.signal
|
|
197
231
|
);
|
|
198
232
|
}
|
|
199
233
|
|
|
@@ -210,7 +244,15 @@ export function createApp(options: ServerAppOptions = {}): Hono {
|
|
|
210
244
|
}
|
|
211
245
|
|
|
212
246
|
export function startServer(options: ServerOptions): RunningServer {
|
|
213
|
-
const
|
|
247
|
+
const namedBodies = new NamedBodyResponder(
|
|
248
|
+
options.namedBodyResolver ??
|
|
249
|
+
new NamedBodyResolver(options.resources ? [createAssetManagerNamedBodyProvider(options.resources)] : []),
|
|
250
|
+
{namedResponseBody: options.namedResponseBody === true}
|
|
251
|
+
);
|
|
252
|
+
const bridge = new WebSocketHttpRequestBridge(options.requestTimeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS, {
|
|
253
|
+
responder: namedBodies,
|
|
254
|
+
maxBodyBytes: options.maxNamedResponseBodyBytes ?? options.maxResourceBodyBytes ?? DEFAULT_MAX_RESOURCE_BODY_BYTES
|
|
255
|
+
});
|
|
214
256
|
const app = createApp({...options, bridge});
|
|
215
257
|
const wss = new WebSocketServer({noServer: true});
|
|
216
258
|
const sockets = new Set<WebSocket>();
|
|
@@ -276,6 +318,11 @@ export function startServer(options: ServerOptions): RunningServer {
|
|
|
276
318
|
};
|
|
277
319
|
}
|
|
278
320
|
|
|
321
|
+
interface BridgeNamedBodyOptions {
|
|
322
|
+
responder: NamedBodyResponder;
|
|
323
|
+
maxBodyBytes: number;
|
|
324
|
+
}
|
|
325
|
+
|
|
279
326
|
class WebSocketHttpRequestBridge implements HttpRequestBridge {
|
|
280
327
|
private socket: WebSocket | null = null;
|
|
281
328
|
private nextRequestId = 1;
|
|
@@ -283,12 +330,16 @@ class WebSocketHttpRequestBridge implements HttpRequestBridge {
|
|
|
283
330
|
string,
|
|
284
331
|
{
|
|
285
332
|
method: string;
|
|
333
|
+
signal?: AbortSignal;
|
|
286
334
|
resolve(response: Response): void;
|
|
287
335
|
timeout: ReturnType<typeof setTimeout>;
|
|
288
336
|
}
|
|
289
337
|
>();
|
|
290
338
|
|
|
291
|
-
public constructor(
|
|
339
|
+
public constructor(
|
|
340
|
+
private readonly requestTimeoutMs: number,
|
|
341
|
+
private readonly namedBodies: BridgeNamedBodyOptions
|
|
342
|
+
) {}
|
|
292
343
|
|
|
293
344
|
public attach(socket: WebSocket): void {
|
|
294
345
|
const previousSocket = this.socket;
|
|
@@ -313,7 +364,7 @@ class WebSocketHttpRequestBridge implements HttpRequestBridge {
|
|
|
313
364
|
}
|
|
314
365
|
}
|
|
315
366
|
|
|
316
|
-
public async forward(message: BridgeRequestMessage, method: string): Promise<Response> {
|
|
367
|
+
public async forward(message: BridgeRequestMessage, method: string, signal?: AbortSignal): Promise<Response> {
|
|
317
368
|
if (!this.socket || this.socket.readyState !== this.socket.OPEN) {
|
|
318
369
|
return jsonResponse({error: 'not_connected'}, 503);
|
|
319
370
|
}
|
|
@@ -328,7 +379,7 @@ class WebSocketHttpRequestBridge implements HttpRequestBridge {
|
|
|
328
379
|
resolve(jsonResponse({error: 'gateway_timeout'}, 504));
|
|
329
380
|
}, this.requestTimeoutMs);
|
|
330
381
|
|
|
331
|
-
this.pending.set(id, {method, resolve, timeout});
|
|
382
|
+
this.pending.set(id, {method, ...(signal === undefined ? {} : {signal}), resolve, timeout});
|
|
332
383
|
try {
|
|
333
384
|
this.socket?.send(JSON.stringify(requestMessage));
|
|
334
385
|
} catch {
|
|
@@ -357,7 +408,9 @@ class WebSocketHttpRequestBridge implements HttpRequestBridge {
|
|
|
357
408
|
if (!pending) return;
|
|
358
409
|
clearTimeout(pending.timeout);
|
|
359
410
|
this.pending.delete(parsed.id);
|
|
360
|
-
|
|
411
|
+
void toHttpResponse(parsed, pending.method, this.namedBodies, pending.signal)
|
|
412
|
+
.then(pending.resolve)
|
|
413
|
+
.catch(() => pending.resolve(jsonResponse({error: 'named_body_failed'}, 502)));
|
|
361
414
|
}
|
|
362
415
|
}
|
|
363
416
|
|
|
@@ -409,7 +462,12 @@ async function createBridgeRequestMessage(request: Request, options: BridgeReque
|
|
|
409
462
|
return message;
|
|
410
463
|
}
|
|
411
464
|
|
|
412
|
-
function toHttpResponse(
|
|
465
|
+
async function toHttpResponse(
|
|
466
|
+
message: BridgeResponseMessage,
|
|
467
|
+
method: string,
|
|
468
|
+
namedBodies: BridgeNamedBodyOptions,
|
|
469
|
+
signal?: AbortSignal
|
|
470
|
+
): Promise<Response> {
|
|
413
471
|
const status = isValidHttpStatus(message.status) ? message.status : 502;
|
|
414
472
|
if (!isValidHttpStatus(message.status)) {
|
|
415
473
|
return jsonResponse({error: 'invalid_bridge_status'}, 502);
|
|
@@ -430,6 +488,28 @@ function toHttpResponse(message: BridgeResponseMessage, method: string): Respons
|
|
|
430
488
|
}
|
|
431
489
|
}
|
|
432
490
|
|
|
491
|
+
if (message.body.kind === 'named') {
|
|
492
|
+
if (status === 204 || status === 205 || status === 304) return new Response(null, {status, headers});
|
|
493
|
+
return namedBodies.responder.respond(
|
|
494
|
+
{
|
|
495
|
+
reference: message.body.reference,
|
|
496
|
+
representation: message.body.representation,
|
|
497
|
+
...(message.body.targetId === undefined ? {} : {targetId: message.body.targetId})
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
method,
|
|
501
|
+
status,
|
|
502
|
+
headers,
|
|
503
|
+
...(signal === undefined ? {} : {signal}),
|
|
504
|
+
maxBodyBytes: Math.min(message.body.maxBytes, namedBodies.maxBodyBytes)
|
|
505
|
+
}
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (message.body.kind === 'unsupported' && message.body.reason === 'invalid_named_body') {
|
|
510
|
+
return jsonResponse({error: 'NAMED_DATA_INVALID_REF'}, 400);
|
|
511
|
+
}
|
|
512
|
+
|
|
433
513
|
if (isBodyForbidden(method, status)) {
|
|
434
514
|
return new Response(null, {status, headers});
|
|
435
515
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<title>Archify visual-check · turbowarp-http-server.architecture.html</title>
|
|
7
|
-
<style>
|
|
8
|
-
*{box-sizing:border-box}body{margin:0;padding:24px;background:#e9eef5;color:#172033;font:14px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}header{max-width:1500px;margin:0 auto 18px}h1{margin:0 0 6px;font-size:20px}p{margin:0;color:#526176}.grid{max-width:1500px;margin:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}figure{margin:0;padding:10px;background:white;border:1px solid #c9d4e3;border-radius:12px;box-shadow:0 10px 30px rgba(15,23,42,.08)}img{display:block;width:100%;height:auto;border:1px solid #e2e8f0}figcaption{padding:9px 4px 2px;color:#526176}@media(max-width:900px){.grid{grid-template-columns:1fr}}
|
|
9
|
-
</style>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<header><h1>Archify visual-check</h1><p>turbowarp-http-server.architecture.html · automated containment pass · visual review pending</p></header>
|
|
13
|
-
<main class="grid">
|
|
14
|
-
<figure>
|
|
15
|
-
<img src="turbowarp-http-server.architecture.visual-check.1440x900.light.png" alt="light 1440 by 900">
|
|
16
|
-
<figcaption><strong>LIGHT</strong> · 1440×900 · containment pass</figcaption>
|
|
17
|
-
</figure>
|
|
18
|
-
<figure>
|
|
19
|
-
<img src="turbowarp-http-server.architecture.visual-check.1440x900.dark.png" alt="dark 1440 by 900">
|
|
20
|
-
<figcaption><strong>DARK</strong> · 1440×900 · containment pass</figcaption>
|
|
21
|
-
</figure>
|
|
22
|
-
<figure>
|
|
23
|
-
<img src="turbowarp-http-server.architecture.visual-check.2048x1320.light.png" alt="light 2048 by 1320">
|
|
24
|
-
<figcaption><strong>LIGHT</strong> · 2048×1320 · containment pass</figcaption>
|
|
25
|
-
</figure>
|
|
26
|
-
<figure>
|
|
27
|
-
<img src="turbowarp-http-server.architecture.visual-check.2048x1320.dark.png" alt="dark 2048 by 1320">
|
|
28
|
-
<figcaption><strong>DARK</strong> · 2048×1320 · containment pass</figcaption>
|
|
29
|
-
</figure>
|
|
30
|
-
</main>
|
|
31
|
-
</body>
|
|
32
|
-
</html>
|