Skip to content

Commit 89bb9bf

Browse files
authored
chore: Migrate off of httpbin (#1218)
1 parent 6695d7a commit 89bb9bf

File tree

13 files changed

+41
-97
lines changed

13 files changed

+41
-97
lines changed

integration-tests/js-compute/fixtures/app/fastly.toml.in

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ service_id = ""
2323
url = "https://compute-sdk-test-backend.edgecompute.app"
2424
override_host = "compute-sdk-test-backend.edgecompute.app"
2525

26-
[local_server.backends.httpbin]
27-
url = "https://httpbin.org"
28-
override_host = "httpbin.org"
29-
3026
[local_server.backends.httpme]
3127
url = "https://http-me.glitch.me"
3228
override_host = "http-me.glitch.me"
@@ -118,11 +114,6 @@ service_id = ""
118114

119115
[setup]
120116
[setup.backends]
121-
122-
[setup.backends.httpbin]
123-
address = "httpbin.org"
124-
port = 443
125-
126117
[setup.backends.httpme]
127118
address = "http-me.glitch.me"
128119
port = 443

integration-tests/js-compute/fixtures/app/src/headers.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@ routes.set('/headers/getsetcookie', async () => {
2525
});
2626

2727
routes.set('/headers/from-response/set', async () => {
28-
const response = await fetch('https://httpbin.org/stream-bytes/11', {
29-
backend: 'httpbin',
28+
const response = await fetch('https://http-me.glitch.me/anything', {
29+
backend: 'httpme',
3030
cacheOverride: new CacheOverride('pass'),
3131
});
3232
response.headers.set('cuStom', 'test');
3333
return response;
3434
});
3535

3636
routes.set('/headers/from-response/delete-invalid', async () => {
37-
const response = await fetch('https://httpbin.org/stream-bytes/11', {
38-
backend: 'httpbin',
37+
const response = await fetch('https://http-me.glitch.me/anything', {
38+
backend: 'httpme',
3939
cacheOverride: new CacheOverride('pass'),
4040
});
4141
response.headers.delete('none');
4242
return response;
4343
});
4444

4545
routes.set('/headers/from-response/set-delete', async () => {
46-
const response = await fetch('https://httpbin.org/stream-bytes/11', {
47-
backend: 'httpbin',
46+
const response = await fetch('https://http-me.glitch.me/anything', {
47+
backend: 'httpme',
4848
cacheOverride: new CacheOverride('pass'),
4949
});
5050
response.headers.set('custom', 'test');

integration-tests/js-compute/fixtures/app/src/manual-framing-headers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ routes.set(
220220
);
221221

222222
async function responseMethod(setManualFramingHeaders) {
223-
const response = await fetch('https://httpbin.org/stream-bytes/11', {
224-
backend: 'httpbin',
223+
const response = await fetch('https://http-me.glitch.me/drip=11', {
224+
backend: 'httpme',
225225
cacheOverride: new CacheOverride('pass'),
226226
});
227227
response.setManualFramingHeaders(setManualFramingHeaders);

integration-tests/js-compute/fixtures/app/src/multiple-set-cookie.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ routes.set('/multiple-set-cookie/response-direct', async () => {
4343
});
4444
routes.set('/multiple-set-cookie/downstream', async () => {
4545
let response = await fetch(
46-
'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',
46+
'https://http-me.glitch.me/append-header=Set-Cookie:test1=1/append-header=Set-Cookie:test2=2/append-header=Set-Cookie:test3=3/anything',
4747
{
48-
backend: 'httpbin',
48+
backend: 'httpme',
4949
},
5050
);
5151

integration-tests/js-compute/fixtures/app/src/request-auto-decompress.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { routes } from './routes.js';
44

55
// Request.fastly.decompressGzip option -- automatic gzip decompression of responses
66
routes.set('/request/constructor/fastly/decompressGzip/true', async () => {
7-
const request = new Request('https://httpbin.org/gzip', {
7+
const request = new Request('https://http-me.glitch.me/gzip', {
88
headers: {
99
accept: 'application/json',
1010
},
11-
backend: 'httpbin',
11+
backend: 'httpme',
1212
fastly: {
1313
decompressGzip: true,
1414
},
@@ -20,11 +20,11 @@ routes.set('/request/constructor/fastly/decompressGzip/true', async () => {
2020
});
2121

2222
routes.set('/request/constructor/fastly/decompressGzip/false', async () => {
23-
const request = new Request('https://httpbin.org/gzip', {
23+
const request = new Request('https://http-me.glitch.me/gzip', {
2424
headers: {
2525
accept: 'application/json',
2626
},
27-
backend: 'httpbin',
27+
backend: 'httpme',
2828
cacheOverride: 'pass',
2929
fastly: {
3030
decompressGzip: false,
@@ -38,11 +38,11 @@ routes.set('/request/constructor/fastly/decompressGzip/false', async () => {
3838
});
3939

4040
routes.set('/fetch/requestinit/fastly/decompressGzip/true', async () => {
41-
const response = await fetch('https://httpbin.org/gzip', {
41+
const response = await fetch('https://http-me.glitch.me/gzip', {
4242
headers: {
4343
accept: 'application/json',
4444
},
45-
backend: 'httpbin',
45+
backend: 'httpme',
4646
fastly: {
4747
decompressGzip: true,
4848
},
@@ -53,11 +53,11 @@ routes.set('/fetch/requestinit/fastly/decompressGzip/true', async () => {
5353
});
5454

5555
routes.set('/fetch/requestinit/fastly/decompressGzip/false', async () => {
56-
const response = await fetch('https://httpbin.org/gzip', {
56+
const response = await fetch('https://http-me.glitch.me/gzip', {
5757
headers: {
5858
accept: 'application/json',
5959
},
60-
backend: 'httpbin',
60+
backend: 'httpme',
6161
cacheOverride: 'pass',
6262
fastly: {
6363
decompressGzip: false,

integration-tests/js-compute/fixtures/app/src/response.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-env serviceworker */
22

33
import { routes } from './routes.js';
4-
import { assert } from './assertions.js';
4+
import { assert, streamToString } from './assertions.js';
55
import { allowDynamicBackends } from 'fastly:experimental';
66

77
routes.set('/response/stall', async (event) => {
@@ -58,21 +58,15 @@ routes.set('/response/ip-port-undefined', async () => {
5858

5959
routes.set('/response/request-body-init', async () => {
6060
allowDynamicBackends(true);
61-
// fetch an image
62-
const downloadResp = await fetch('https://httpbin.org/image', {
63-
headers: {
64-
accept: 'image/webp',
65-
},
66-
});
67-
// stream it through an echo proxy
61+
const downloadResp = await fetch('https://http-me.glitch.me/json');
6862
const postResp = await fetch(
69-
new Request('https://httpbin.org/anything', {
63+
new Request('https://http-me.glitch.me/anything', {
7064
method: 'POST',
7165
body: downloadResp.body,
7266
}),
7367
);
74-
// finally stream back to user
75-
return postResp;
68+
let body = await postResp.json();
69+
assert(JSON.parse(body['body'])['data']['name'] === 'Test Product', true);
7670
});
7771

7872
routes.set('/response/blob', async () => {

integration-tests/js-compute/fixtures/app/src/tee.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-env serviceworker */
22
import { routes } from './routes.js';
3+
import { assert } from './assertions.js';
34

45
routes.set('/tee', async function (event) {
56
const req = event.request;
@@ -13,29 +14,28 @@ routes.set('/tee', async function (event) {
1314
// `pending_req_select`, as we were waiting on an http request whose body had
1415
// not been closed.
1516
let res = await fetch(
16-
new Request('/post', {
17+
new Request('/anything', {
1718
body: body1,
1819
headers: req.headers,
1920
method: req.method,
20-
backend: 'httpbin',
21+
backend: 'httpme',
2122
}),
2223
);
2324
let body = await res.json();
24-
25-
return new Response(body.data);
25+
assert(body['body'], 'hello world!');
2626
});
2727

2828
routes.set('/tee/error', async function (event) {
2929
const req = event.request;
30-
let res = fetch('/post', {
30+
let res = fetch('/anything', {
3131
method: 'POST',
3232
body: new ReadableStream({
3333
start: (controller) => {
3434
controller.enqueue('Test');
3535
controller.close();
3636
},
3737
}),
38-
backend: 'httpbin',
38+
backend: 'httpme',
3939
});
4040

4141
return res

integration-tests/js-compute/fixtures/app/src/timers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ import { CacheOverride } from 'fastly:cache-override';
340340
});
341341
routes.set('/setTimeout/fetch-timeout', async () => {
342342
let timedOut = false;
343-
const first = fetch('https://httpbin.org/delay/2', {
344-
backend: 'httpbin',
343+
const first = fetch('https://http-me.glitch.me/wait=200', {
344+
backend: 'httpme',
345345
cacheOverride: new CacheOverride('pass'),
346346
});
347347
const second = Promise.race([
348-
fetch('https://httpbin.org/delay/2', {
349-
backend: 'httpbin',
348+
fetch('https://http-me.glitch.me/wait=200', {
349+
backend: 'httpme',
350350
cacheOverride: new CacheOverride('pass'),
351351
}),
352352
new Promise((resolve) => setTimeout(resolve, 5)).then(() => {

integration-tests/js-compute/fixtures/app/tests.json

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,19 +1159,11 @@
11591159
},
11601160
"GET /multiple-set-cookie/downstream": {
11611161
"downstream_response": {
1162-
"status": 302,
1162+
"status": 200,
11631163
"headers": [
1164-
["Set-Cookie", "1=1; Path=/"],
1165-
["Set-Cookie", "2=2; Path=/"],
1166-
["Set-Cookie", "3=3; Path=/"],
1167-
["Set-Cookie", "4=4; Path=/"],
1168-
["Set-Cookie", "5=5; Path=/"],
1169-
["Set-Cookie", "6=6; Path=/"],
1170-
["Set-Cookie", "7=7; Path=/"],
1171-
["Set-Cookie", "8=8; Path=/"],
1172-
["Set-Cookie", "9=9; Path=/"],
1173-
["Set-Cookie", "10=10; Path=/"],
1174-
["Set-Cookie", "11=11; Path=/"]
1164+
["Set-Cookie", "test1=1"],
1165+
["Set-Cookie", "test2=2"],
1166+
["Set-Cookie", "test3=3"]
11751167
]
11761168
}
11771169
},
@@ -1234,21 +1226,7 @@
12341226
"GET /response/arrayBuffer/guest-backed-stream": {},
12351227
"GET /response/json": {},
12361228
"GET /response/redirect": {},
1237-
"GET /response/request-body-init": {
1238-
"flake": true,
1239-
"downstream_response": {
1240-
"status": 200,
1241-
"body_prefix": [
1242-
123, 10, 32, 32, 34, 97, 114, 103, 115, 34, 58, 32, 123, 125, 44, 32,
1243-
10, 32, 32, 34, 100, 97, 116, 97, 34, 58, 32, 34, 100, 97, 116, 97, 58,
1244-
97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 111, 99, 116,
1245-
101, 116, 45, 115, 116, 114, 101, 97, 109, 59, 98, 97, 115, 101, 54, 52,
1246-
44, 85, 107, 108, 71, 82, 107, 65, 112, 65, 65, 66, 88, 82, 85, 74, 81,
1247-
86, 108, 65, 52, 87, 65, 111, 65, 65, 65, 65, 69, 65, 65, 65, 65, 69, 81
1248-
],
1249-
"body_suffix": [123, 10, 32, 32, 34, 97, 114, 103, 115, 34, 58, 32]
1250-
}
1251-
},
1229+
"GET /response/request-body-init": {},
12521230
"GET /response/ip-port-undefined": {},
12531231
"GET /setInterval/exposed-as-global": {},
12541232
"GET /setInterval/interface": {},
@@ -1322,10 +1300,6 @@
13221300
"pathname": "/tee",
13231301
"headers": ["Content-Type", "application/json"],
13241302
"body": "hello world!"
1325-
},
1326-
"downstream_response": {
1327-
"status": 200,
1328-
"body": "hello world!"
13291303
}
13301304
},
13311305
"GET /tee/error": {

integration-tests/js-compute/fixtures/module-mode/fastly.toml.in

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ service_id = ""
2323
url = "https://compute-sdk-test-backend.edgecompute.app"
2424
override_host = "compute-sdk-test-backend.edgecompute.app"
2525

26-
[local_server.backends.httpbin]
27-
url = "https://httpbin.org"
28-
override_host = "httpbin.org"
29-
3026
[local_server.backends.httpme]
3127
url = "https://http-me.glitch.me"
3228
override_host = "http-me.glitch.me"
@@ -118,11 +114,6 @@ service_id = ""
118114

119115
[setup]
120116
[setup.backends]
121-
122-
[setup.backends.httpbin]
123-
address = "httpbin.org"
124-
port = 443
125-
126117
[setup.backends.httpme]
127118
address = "http-me.glitch.me"
128119
port = 443

0 commit comments

Comments
 (0)