Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Cache API #1051

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions integration-tests/js-compute/fixtures/app/src/cache-override.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,6 @@ import { isRunningLocally, routes } from './routes.js';
);
},
);
// https://tc39.es/ecma262/#sec-tostring
routes.set(
'/cache-override/constructor/parameter-calls-7.1.17-ToString',
async () => {
let sentinel;
const test = () => {
sentinel = Symbol();
const name = {
toString() {
throw sentinel;
},
};
new CacheOverride(name);
};
assertThrows(test);
try {
test();
} catch (thrownError) {
assert(thrownError, sentinel, 'thrownError === sentinel');
}
assertThrows(
() => new CacheOverride(Symbol()),
TypeError,
`can't convert symbol to string`,
);
},
);
routes.set('/cache-override/constructor/empty-parameter', async () => {
assertThrows(
() => {
Expand Down Expand Up @@ -80,6 +53,9 @@ import { isRunningLocally, routes } from './routes.js';
assertDoesNotThrow(() => {
new CacheOverride('override', {});
});
assertDoesNotThrow(() => {
new CacheOverride({});
});
});
}
// Using CacheOverride
Expand Down
1 change: 0 additions & 1 deletion integration-tests/js-compute/fixtures/app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import './cache-simple.js';
import './client.js';
import './compute.js';
import './config-store.js';
import './console.js';
import './crypto.js';
import './device.js';
import './dictionary.js';
Expand Down
49 changes: 0 additions & 49 deletions integration-tests/js-compute/fixtures/app/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
}
},
"GET /cache-override/constructor/called-as-regular-function": {},
"GET /cache-override/constructor/parameter-calls-7.1.17-ToString": {},
"GET /cache-override/constructor/empty-parameter": {},
"GET /cache-override/constructor/invalid-mode": {},
"GET /cache-override/constructor/valid-mode": {},
Expand Down Expand Up @@ -317,53 +316,6 @@
"GET /client/tlsCipherOpensslName": {},
"GET /client/tlsProtocol": {},
"GET /config-store": {},
"GET /console": {
"environments": ["viceroy"],
"logs": [
"stdout :: Log: Happy birthday Aki and Yuki!",
"stdout :: Log: Map: Map(2) { { a: 1, b: { c: 2 } } => 2, [ function foo() {\n }] => {} }",
"stdout :: Log: Set: Set(3) { { a: 1, b: { c: 2 } }, 2, 3 }",
"stdout :: Log: Array: [1, 2, 3, [], 5]",
"stdout :: Log: Object: { a: 1, b: 2, c: 3, d: [ d() {\n }], f: [Getter], g: [ function bar() {\n}], h: [ function from() {\n[native code]\n}] }",
"stdout :: Log: function: [ function() {\n }]",
"stdout :: Log: boolean: true",
"stdout :: Log: undefined: undefined",
"stdout :: Log: null: null",
"stdout :: Log: proxy: { a: 21 }",
"stdout :: Log: Infinity: Infinity",
"stdout :: Log: NaN: NaN",
"stdout :: Log: Symbol: Symbol(\"wow\")",
"stdout :: Log: Error: (new Error(\"uh oh\", \"<stdin>\", 7644))",
"stdout :: Log: Number: 1",
"stdout :: Log: Number: 1.111",
"stdout :: Log: BigInt: 10n",
"stdout :: Log: Date: new Date(1660816667120)",
"stdout :: Log: string: cake",
"stdout :: Log: RegExp: /magic/",
"stdout :: Log: Int8Array: Int8Array [1, 3, 4, 2, 5, 6, -97]",
"stdout :: Log: Uint8Array: Uint8Array [1, 3, 4, 2, 5, 6, 159]",
"stdout :: Log: Uint8ClampedArray: Uint8ClampedArray [1, 3, 4, 2, 5, 6, 255]",
"stdout :: Log: Int16Array: Int16Array [1, 3, 4, 2, 5, 6, -31073]",
"stdout :: Log: Uint16Array: Uint16Array [1, 3, 4, 2, 5, 6, 34463]",
"stdout :: Log: Int32Array: Int32Array [1, 3, 4, 2, 5, 6, 99999]",
"stdout :: Log: Uint32Array: Uint32Array [1, 3, 4, 2, 5, 6, 99999]",
"stdout :: Log: Float32Array: Float32Array [1, 3, 4, 2, 5, 6, 99999]",
"stdout :: Log: Float64Array: Float64Array [1, 3, 4, 2, 5, 6, 99999]",
"stdout :: Log: BigInt64Array: BigInt64Array [1n, 3n, 4n, 2n, 5n, 6n, 99999n]",
"stdout :: Log: BigUint64Array: BigUint64Array [1n, 3n, 4n, 2n, 5n, 6n, 99999n]",
"stdout :: Log: WeakMap: WeakMap { <items unknown> }",
"stdout :: Log: WeakSet: WeakSet { <items unknown> }",
"stdout :: Log: Promise: Promise { <pending> }",
"stdout :: Log: resolved promise: Promise { 9 }",
"stdout :: Log: rejected promise: Promise { <rejected> (new Error(\"oops\", \"<stdin>\", 7689)) }",
"stdout :: Log: Response: Response { redirected: false, type: \"default\", url: \"\", status: 200, ok: true, statusText: \"\", version: 2, headers: Headers {}, body: ReadableStream { locked: false }, bodyUsed: false }",
"stdout :: Log: Request: Request { method: \"POST\", url: \"https://www.fastly.com/\", version: 2, headers: Headers {}, backend: undefined, body: null, bodyUsed: false }",
"stdout :: Log: ReadableStream: ReadableStream { locked: false }",
"stdout :: Log: TransformStream: TransformStream { readable: ReadableStream { locked: false }, writable: WritableStream {} }",
"stdout :: Log: WritableStream: WritableStream {}",
"stdout :: Log: URL: URL { hash: \"\", host: \"www.test.com:123\", hostname: \"www.test.com\", href: \"https://www.test.com:123/asdf?some&params=val\", origin: \"https://www.test.com:123\", password: \"\", pathname: \"/asdf\", port: \"123\", protocol: \"https:\", search: \"?some&params=val\", searchParams: URLSearchParams {}, username: \"\" }"
]
},
"GET /crypto": {
"downstream_response": {
"status": 200,
Expand Down Expand Up @@ -1332,7 +1284,6 @@
"headers": [["cuStom", "test"]]
}
},

"GET /FastlyBody/interface": {
"environments": ["compute"],
"downstream_response": {
Expand Down
Loading
Loading