diff --git a/integration-tests/js-compute/fixtures/app/fastly.toml.in b/integration-tests/js-compute/fixtures/app/fastly.toml.in index dcc121fbed..4ef4c4a5b2 100644 --- a/integration-tests/js-compute/fixtures/app/fastly.toml.in +++ b/integration-tests/js-compute/fixtures/app/fastly.toml.in @@ -23,10 +23,6 @@ service_id = "" url = "https://compute-sdk-test-backend.edgecompute.app" override_host = "compute-sdk-test-backend.edgecompute.app" - [local_server.backends.httpbin] - url = "https://httpbin.org" - override_host = "httpbin.org" - [local_server.backends.httpme] url = "https://http-me.glitch.me" override_host = "http-me.glitch.me" @@ -118,11 +114,6 @@ service_id = "" [setup] [setup.backends] - - [setup.backends.httpbin] - address = "httpbin.org" - port = 443 - [setup.backends.httpme] address = "http-me.glitch.me" port = 443 diff --git a/integration-tests/js-compute/fixtures/app/src/headers.js b/integration-tests/js-compute/fixtures/app/src/headers.js index 977442b6cb..9f6e93413f 100644 --- a/integration-tests/js-compute/fixtures/app/src/headers.js +++ b/integration-tests/js-compute/fixtures/app/src/headers.js @@ -25,8 +25,8 @@ routes.set('/headers/getsetcookie', async () => { }); routes.set('/headers/from-response/set', async () => { - const response = await fetch('https://httpbin.org/stream-bytes/11', { - backend: 'httpbin', + const response = await fetch('https://http-me.glitch.me/anything', { + backend: 'httpme', cacheOverride: new CacheOverride('pass'), }); response.headers.set('cuStom', 'test'); @@ -34,8 +34,8 @@ routes.set('/headers/from-response/set', async () => { }); routes.set('/headers/from-response/delete-invalid', async () => { - const response = await fetch('https://httpbin.org/stream-bytes/11', { - backend: 'httpbin', + const response = await fetch('https://http-me.glitch.me/anything', { + backend: 'httpme', cacheOverride: new CacheOverride('pass'), }); response.headers.delete('none'); @@ -43,8 +43,8 @@ routes.set('/headers/from-response/delete-invalid', async () => { }); routes.set('/headers/from-response/set-delete', async () => { - const response = await fetch('https://httpbin.org/stream-bytes/11', { - backend: 'httpbin', + const response = await fetch('https://http-me.glitch.me/anything', { + backend: 'httpme', cacheOverride: new CacheOverride('pass'), }); response.headers.set('custom', 'test'); diff --git a/integration-tests/js-compute/fixtures/app/src/manual-framing-headers.js b/integration-tests/js-compute/fixtures/app/src/manual-framing-headers.js index 98bf0d630c..f5371bdd12 100644 --- a/integration-tests/js-compute/fixtures/app/src/manual-framing-headers.js +++ b/integration-tests/js-compute/fixtures/app/src/manual-framing-headers.js @@ -220,8 +220,8 @@ routes.set( ); async function responseMethod(setManualFramingHeaders) { - const response = await fetch('https://httpbin.org/stream-bytes/11', { - backend: 'httpbin', + const response = await fetch('https://http-me.glitch.me/drip=11', { + backend: 'httpme', cacheOverride: new CacheOverride('pass'), }); response.setManualFramingHeaders(setManualFramingHeaders); diff --git a/integration-tests/js-compute/fixtures/app/src/multiple-set-cookie.js b/integration-tests/js-compute/fixtures/app/src/multiple-set-cookie.js index ee34a5579d..c9045bd193 100644 --- a/integration-tests/js-compute/fixtures/app/src/multiple-set-cookie.js +++ b/integration-tests/js-compute/fixtures/app/src/multiple-set-cookie.js @@ -43,9 +43,9 @@ routes.set('/multiple-set-cookie/response-direct', async () => { }); routes.set('/multiple-set-cookie/downstream', async () => { let response = await fetch( - 'https://httpbin.org/cookies/set?1=1&2=2&3=3&4=4&5=5&6=6&7=7&8=8&9=9&10=10&11=11', + 'https://http-me.glitch.me/append-header=Set-Cookie:test1=1/append-header=Set-Cookie:test2=2/append-header=Set-Cookie:test3=3/anything', { - backend: 'httpbin', + backend: 'httpme', }, ); diff --git a/integration-tests/js-compute/fixtures/app/src/request-auto-decompress.js b/integration-tests/js-compute/fixtures/app/src/request-auto-decompress.js index 898e8a4946..178e386222 100644 --- a/integration-tests/js-compute/fixtures/app/src/request-auto-decompress.js +++ b/integration-tests/js-compute/fixtures/app/src/request-auto-decompress.js @@ -4,11 +4,11 @@ import { routes } from './routes.js'; // Request.fastly.decompressGzip option -- automatic gzip decompression of responses routes.set('/request/constructor/fastly/decompressGzip/true', async () => { - const request = new Request('https://httpbin.org/gzip', { + const request = new Request('https://http-me.glitch.me/gzip', { headers: { accept: 'application/json', }, - backend: 'httpbin', + backend: 'httpme', fastly: { decompressGzip: true, }, @@ -20,11 +20,11 @@ routes.set('/request/constructor/fastly/decompressGzip/true', async () => { }); routes.set('/request/constructor/fastly/decompressGzip/false', async () => { - const request = new Request('https://httpbin.org/gzip', { + const request = new Request('https://http-me.glitch.me/gzip', { headers: { accept: 'application/json', }, - backend: 'httpbin', + backend: 'httpme', cacheOverride: 'pass', fastly: { decompressGzip: false, @@ -38,11 +38,11 @@ routes.set('/request/constructor/fastly/decompressGzip/false', async () => { }); routes.set('/fetch/requestinit/fastly/decompressGzip/true', async () => { - const response = await fetch('https://httpbin.org/gzip', { + const response = await fetch('https://http-me.glitch.me/gzip', { headers: { accept: 'application/json', }, - backend: 'httpbin', + backend: 'httpme', fastly: { decompressGzip: true, }, @@ -53,11 +53,11 @@ routes.set('/fetch/requestinit/fastly/decompressGzip/true', async () => { }); routes.set('/fetch/requestinit/fastly/decompressGzip/false', async () => { - const response = await fetch('https://httpbin.org/gzip', { + const response = await fetch('https://http-me.glitch.me/gzip', { headers: { accept: 'application/json', }, - backend: 'httpbin', + backend: 'httpme', cacheOverride: 'pass', fastly: { decompressGzip: false, diff --git a/integration-tests/js-compute/fixtures/app/src/response.js b/integration-tests/js-compute/fixtures/app/src/response.js index 292f4b0ec1..5aff9d8036 100644 --- a/integration-tests/js-compute/fixtures/app/src/response.js +++ b/integration-tests/js-compute/fixtures/app/src/response.js @@ -1,7 +1,7 @@ /* eslint-env serviceworker */ import { routes } from './routes.js'; -import { assert } from './assertions.js'; +import { assert, streamToString } from './assertions.js'; import { allowDynamicBackends } from 'fastly:experimental'; routes.set('/response/stall', async (event) => { @@ -58,21 +58,15 @@ routes.set('/response/ip-port-undefined', async () => { routes.set('/response/request-body-init', async () => { allowDynamicBackends(true); - // fetch an image - const downloadResp = await fetch('https://httpbin.org/image', { - headers: { - accept: 'image/webp', - }, - }); - // stream it through an echo proxy + const downloadResp = await fetch('https://http-me.glitch.me/json'); const postResp = await fetch( - new Request('https://httpbin.org/anything', { + new Request('https://http-me.glitch.me/anything', { method: 'POST', body: downloadResp.body, }), ); - // finally stream back to user - return postResp; + let body = await postResp.json(); + assert(JSON.parse(body['body'])['data']['name'] === 'Test Product', true); }); routes.set('/response/blob', async () => { diff --git a/integration-tests/js-compute/fixtures/app/src/tee.js b/integration-tests/js-compute/fixtures/app/src/tee.js index 553329f70d..5c1b3c587a 100644 --- a/integration-tests/js-compute/fixtures/app/src/tee.js +++ b/integration-tests/js-compute/fixtures/app/src/tee.js @@ -1,5 +1,6 @@ /* eslint-env serviceworker */ import { routes } from './routes.js'; +import { assert } from './assertions.js'; routes.set('/tee', async function (event) { const req = event.request; @@ -13,21 +14,20 @@ routes.set('/tee', async function (event) { // `pending_req_select`, as we were waiting on an http request whose body had // not been closed. let res = await fetch( - new Request('/post', { + new Request('/anything', { body: body1, headers: req.headers, method: req.method, - backend: 'httpbin', + backend: 'httpme', }), ); let body = await res.json(); - - return new Response(body.data); + assert(body['body'], 'hello world!'); }); routes.set('/tee/error', async function (event) { const req = event.request; - let res = fetch('/post', { + let res = fetch('/anything', { method: 'POST', body: new ReadableStream({ start: (controller) => { @@ -35,7 +35,7 @@ routes.set('/tee/error', async function (event) { controller.close(); }, }), - backend: 'httpbin', + backend: 'httpme', }); return res diff --git a/integration-tests/js-compute/fixtures/app/src/timers.js b/integration-tests/js-compute/fixtures/app/src/timers.js index ae7e5bf21e..ca64d0ec6e 100644 --- a/integration-tests/js-compute/fixtures/app/src/timers.js +++ b/integration-tests/js-compute/fixtures/app/src/timers.js @@ -340,13 +340,13 @@ import { CacheOverride } from 'fastly:cache-override'; }); routes.set('/setTimeout/fetch-timeout', async () => { let timedOut = false; - const first = fetch('https://httpbin.org/delay/2', { - backend: 'httpbin', + const first = fetch('https://http-me.glitch.me/wait=200', { + backend: 'httpme', cacheOverride: new CacheOverride('pass'), }); const second = Promise.race([ - fetch('https://httpbin.org/delay/2', { - backend: 'httpbin', + fetch('https://http-me.glitch.me/wait=200', { + backend: 'httpme', cacheOverride: new CacheOverride('pass'), }), new Promise((resolve) => setTimeout(resolve, 5)).then(() => { diff --git a/integration-tests/js-compute/fixtures/app/tests.json b/integration-tests/js-compute/fixtures/app/tests.json index 6c4763e156..189115e5d6 100644 --- a/integration-tests/js-compute/fixtures/app/tests.json +++ b/integration-tests/js-compute/fixtures/app/tests.json @@ -1159,19 +1159,11 @@ }, "GET /multiple-set-cookie/downstream": { "downstream_response": { - "status": 302, + "status": 200, "headers": [ - ["Set-Cookie", "1=1; Path=/"], - ["Set-Cookie", "2=2; Path=/"], - ["Set-Cookie", "3=3; Path=/"], - ["Set-Cookie", "4=4; Path=/"], - ["Set-Cookie", "5=5; Path=/"], - ["Set-Cookie", "6=6; Path=/"], - ["Set-Cookie", "7=7; Path=/"], - ["Set-Cookie", "8=8; Path=/"], - ["Set-Cookie", "9=9; Path=/"], - ["Set-Cookie", "10=10; Path=/"], - ["Set-Cookie", "11=11; Path=/"] + ["Set-Cookie", "test1=1"], + ["Set-Cookie", "test2=2"], + ["Set-Cookie", "test3=3"] ] } }, @@ -1234,21 +1226,7 @@ "GET /response/arrayBuffer/guest-backed-stream": {}, "GET /response/json": {}, "GET /response/redirect": {}, - "GET /response/request-body-init": { - "flake": true, - "downstream_response": { - "status": 200, - "body_prefix": [ - 123, 10, 32, 32, 34, 97, 114, 103, 115, 34, 58, 32, 123, 125, 44, 32, - 10, 32, 32, 34, 100, 97, 116, 97, 34, 58, 32, 34, 100, 97, 116, 97, 58, - 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 111, 99, 116, - 101, 116, 45, 115, 116, 114, 101, 97, 109, 59, 98, 97, 115, 101, 54, 52, - 44, 85, 107, 108, 71, 82, 107, 65, 112, 65, 65, 66, 88, 82, 85, 74, 81, - 86, 108, 65, 52, 87, 65, 111, 65, 65, 65, 65, 69, 65, 65, 65, 65, 69, 81 - ], - "body_suffix": [123, 10, 32, 32, 34, 97, 114, 103, 115, 34, 58, 32] - } - }, + "GET /response/request-body-init": {}, "GET /response/ip-port-undefined": {}, "GET /setInterval/exposed-as-global": {}, "GET /setInterval/interface": {}, @@ -1322,10 +1300,6 @@ "pathname": "/tee", "headers": ["Content-Type", "application/json"], "body": "hello world!" - }, - "downstream_response": { - "status": 200, - "body": "hello world!" } }, "GET /tee/error": { diff --git a/integration-tests/js-compute/fixtures/module-mode/fastly.toml.in b/integration-tests/js-compute/fixtures/module-mode/fastly.toml.in index 0e6e6ef55b..3141d7e249 100644 --- a/integration-tests/js-compute/fixtures/module-mode/fastly.toml.in +++ b/integration-tests/js-compute/fixtures/module-mode/fastly.toml.in @@ -23,10 +23,6 @@ service_id = "" url = "https://compute-sdk-test-backend.edgecompute.app" override_host = "compute-sdk-test-backend.edgecompute.app" - [local_server.backends.httpbin] - url = "https://httpbin.org" - override_host = "httpbin.org" - [local_server.backends.httpme] url = "https://http-me.glitch.me" override_host = "http-me.glitch.me" @@ -118,11 +114,6 @@ service_id = "" [setup] [setup.backends] - - [setup.backends.httpbin] - address = "httpbin.org" - port = 443 - [setup.backends.httpme] address = "http-me.glitch.me" port = 443 diff --git a/integration-tests/js-compute/fixtures/module-mode/src/http-cache.js b/integration-tests/js-compute/fixtures/module-mode/src/http-cache.js index 03ced0272f..3e8c02b653 100644 --- a/integration-tests/js-compute/fixtures/module-mode/src/http-cache.js +++ b/integration-tests/js-compute/fixtures/module-mode/src/http-cache.js @@ -11,7 +11,7 @@ import { CacheOverride } from 'fastly:cache-override'; // generate a unique URL everytime so that we never work on a populated cache const getTestUrl = (path = `/${Math.random().toString().slice(2)}`) => - 'https://httpbin.org/anything' + path; + 'https://http-me.glitch.me/anything' + path; // afterSend error handling { @@ -466,7 +466,7 @@ const getTestUrl = (path = `/${Math.random().toString().slice(2)}`) => }); strictEqual(calledAfterSend, true); // verify we get a proper response (url included in response) - strictEqual((await res.json()).url, url); + strictEqual('https://http-me.glitch.me' + (await res.json()).url, url); }); // Test response property mutations diff --git a/integration-tests/js-compute/fixtures/module-mode/src/kv-store.js b/integration-tests/js-compute/fixtures/module-mode/src/kv-store.js index a1f9dd094a..961b476a01 100644 --- a/integration-tests/js-compute/fixtures/module-mode/src/kv-store.js +++ b/integration-tests/js-compute/fixtures/module-mode/src/kv-store.js @@ -65,12 +65,7 @@ const debug = sdkVersion.endsWith('-debug'); metadata: 'cbad', }); const c5Entry = await store.get('c5'); - if (isRunningLocally()) { - strictEqual(await c5Entry.text(), 'cbad'); - } else { - // for some reason, compute doesn't support prepend? - strictEqual(await c5Entry.text(), 'd'); - } + strictEqual(await c5Entry.text(), 'cbad'); assertRejects(async () => await c5Entry.metadataText(), TypeError); // TTL only supported on compute not viceroy diff --git a/integration-tests/js-compute/fixtures/module-mode/tests.json b/integration-tests/js-compute/fixtures/module-mode/tests.json index 41ecbb6971..ea472ea30a 100644 --- a/integration-tests/js-compute/fixtures/module-mode/tests.json +++ b/integration-tests/js-compute/fixtures/module-mode/tests.json @@ -196,7 +196,6 @@ "date": true, "content-type": true, "fastly_service_version": true, - "server": true, "custom": "custom-header", "x-cache": true, "x-cache-hits": true,