Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## next

- feat(definePlugin): helper function to create plugins
- chore(package.json): update to httpxy@0.5.2
- fix(ipv6): preserve credentials when normalizing bracketed IPv6 target string

## [v4.0.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v4.0.0)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
},
"dependencies": {
"debug": "^4.4.3",
"httpxy": "^0.5.1",
"httpxy": "^0.5.2",
"is-glob": "^4.0.3",
"is-plain-obj": "^4.1.0",
"micromatch": "^4.0.8"
Expand Down
6 changes: 6 additions & 0 deletions src/utils/ipv6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ function normalizeIPv6ProxyTarget(target: Options['target'], optionName: 'target
if (targetUrl && isBracketedIPv6Hostname(targetUrl.hostname)) {
debug('normalized IPv6 "%s" %s', optionName, target);

const auth =
targetUrl.username || targetUrl.password
? `${targetUrl.username}:${targetUrl.password}`
: undefined;

return {
hostname: stripBrackets(targetUrl.hostname),
auth,
pathname: targetUrl.pathname,
port: targetUrl.port,
protocol: targetUrl.protocol,
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/ipv6.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
});

const app = createApp(proxy);
const response = await request(app).get('/api').expect(200);

Check failure on line 32 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:32:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 32 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:32:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 32 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:32:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 32 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:32:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 32 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:32:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 32 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:32:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 32 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:32:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 32 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:32:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

expect(response.text).toBe('/api');
});
Expand All @@ -46,7 +46,7 @@
});

const app = createApp(proxy);
const response = await request(app).get('/api').expect(200);

Check failure on line 49 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to unspecified ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:49:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 49 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to unspecified ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:49:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 49 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to unspecified ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:49:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 49 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to unspecified ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:49:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 49 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to unspecified ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:49:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 49 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to unspecified ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:49:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 49 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to unspecified ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:49:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 49 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to unspecified ipv6 target using bracket notation with port

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:49:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

expect(response.text).toBe('/api');
});
Expand All @@ -68,7 +68,7 @@
});

const app = createApp(proxy);
const response = await request(app).get('/api?foo=bar&baz=qux').expect(200);

Check failure on line 71 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve query params

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:71:69 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 71 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve query params

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:71:69 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 71 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve query params

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:71:69 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 71 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve query params

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:71:69 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 71 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve query params

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:71:69 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 71 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve query params

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:71:69 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 71 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve query params

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:71:69 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 71 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve query params

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:71:69 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

expect(receivedPath).toBe('/api?foo=bar&baz=qux');
expect(response.text).toBe('foo=bar&baz=qux');
Expand All @@ -91,7 +91,7 @@
});

const app = createApp(proxy);
const response = await request(app).get('/api?q=hello%20world&page=1').expect(200);

Check failure on line 94 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve search params with special characters

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:94:76 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 94 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve search params with special characters

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:94:76 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 94 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve search params with special characters

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:94:76 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 94 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve search params with special characters

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:94:76 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 94 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve search params with special characters

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:94:76 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 94 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve search params with special characters

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:94:76 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 94 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve search params with special characters

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:94:76 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 94 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target and preserve search params with special characters

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:94:76 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

expect(receivedPath).toBe('/api?q=hello%20world&page=1');
expect(response.text).toBe('q=hello%20world&page=1');
Expand All @@ -112,7 +112,7 @@
});

const app = createApp(proxy);
await request(app).post('/api').expect(200);

Check failure on line 115 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should forward requests to ipv6 target using forward option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:115:37 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 115 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should forward requests to ipv6 target using forward option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:115:37 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 115 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should forward requests to ipv6 target using forward option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:115:37 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 115 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should forward requests to ipv6 target using forward option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:115:37 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 115 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should forward requests to ipv6 target using forward option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:115:37 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 115 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should forward requests to ipv6 target using forward option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:115:37 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 115 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should forward requests to ipv6 target using forward option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:115:37 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 115 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should forward requests to ipv6 target using forward option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:115:37 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

expect(forwardedPath).toBe('/api');
});
Expand All @@ -130,7 +130,7 @@
});

const app = createApp(proxy);
const response = await request(app).get('/api').expect(200);

Check failure on line 133 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via router function (no static target)

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:133:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 133 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via router function (no static target)

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:133:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 133 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via router function (no static target)

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:133:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 133 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via router function (no static target)

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:133:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 133 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via router function (no static target)

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:133:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 133 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via router function (no static target)

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:133:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 133 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via router function (no static target)

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:133:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 133 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via router function (no static target)

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:133:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

expect(response.text).toBe('/api');
});
Expand All @@ -148,7 +148,7 @@
});

const app = createApp(proxy);
const response = await request(app).get('/api').expect(200);

Check failure on line 151 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via async router function

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:151:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 151 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via async router function

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:151:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 151 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via async router function

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:151:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 151 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via async router function

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:151:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 151 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via async router function

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:151:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 151 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via async router function

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:151:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 151 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via async router function

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:151:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 151 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target resolved via async router function

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:151:53 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

expect(response.text).toBe('/api');
});
Expand All @@ -157,7 +157,7 @@
let receivedPath: string | undefined;
let authorizationHeader: string | undefined;

await targetServer.forGet('/api').thenCallback((req) => {
await targetServer.forGet('/api/').thenCallback((req) => {
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regression in unjs/httpxy#138

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/unjs/httpxy/releases/tag/v0.5.3 is out

unjs/httpxy#142 will add ci to make sure it won't happen again

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this branch to v0.5.3.
Can confirm the revert is working. 🙌

The local patch for mockttp is also working. Just have to wait for httptoolkit/mockttp#201 to land.

Thanks for the fast response and providing an awesome solution with the ecosystem test 🙏

receivedPath = req.path;
const authHeader = req.headers.authorization;
authorizationHeader = Array.isArray(authHeader) ? authHeader[0] : authHeader;
Expand All @@ -174,9 +174,9 @@
});

const app = createApp(proxy);
await request(app).get('/').expect(200);

Check failure on line 177 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target with base path and auth option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:177:33 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 177 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target with base path and auth option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:177:33 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 177 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target with base path and auth option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:177:33 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 177 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target with base path and auth option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:177:33 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 177 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (22.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target with base path and auth option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:177:33 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 177 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Coverage

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target with base path and auth option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:177:33 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 177 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (26.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target with base path and auth option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:177:33 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

Check failure on line 177 in test/e2e/ipv6.spec.ts

View workflow job for this annotation

GitHub Actions / Test (24.x)

test/e2e/ipv6.spec.ts > ipv6 integration > should proxy to ipv6 target with base path and auth option

Error: expected 200 "OK", got 400 "Bad Request" ❯ test/e2e/ipv6.spec.ts:177:33 ❯ Test._assertStatus node_modules/supertest/lib/test.js:309:14 ❯ node_modules/supertest/lib/test.js:365:13 ❯ Test._assertFunction node_modules/supertest/lib/test.js:342:13 ❯ Test.assert node_modules/supertest/lib/test.js:195:23 ❯ localAssert node_modules/supertest/lib/test.js:138:14 ❯ Server.<anonymous> node_modules/supertest/lib/test.js:152:11

expect(receivedPath).toBe('/api');
expect(receivedPath).toBe('/api/');
expect(authorizationHeader).toBe('Basic dXNlcjpwYXNz'); // cspell:disable-line
});
});
17 changes: 17 additions & 0 deletions test/unit/utils/ipv6.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@ describe('normalizeIPv6Targets()', () => {
});
});

it('should preserve credentials when normalizing bracketed IPv6 target string', () => {
const options: Options = {
target: 'http://user:pass@[::1]:8888/api',
};

normalizeIPv6LiteralTargets(options);

expect(options.target).toEqual({
auth: 'user:pass',
hostname: '::1',
pathname: '/api',
port: '8888',
protocol: 'http:',
search: '',
});
});

it('should normalize bracketed IPv6 target URL into a target object', () => {
const options: Options = {
target: new URL('http://[::1]:8888/api'),
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2532,10 +2532,10 @@ https-proxy-agent@^7.0.6:
agent-base "^7.1.2"
debug "4"

httpxy@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/httpxy/-/httpxy-0.5.1.tgz#c0cccd78672995968eee57666c3e3cfa822c2806"
integrity sha512-JPhqYiixe1A1I+MXDewWDZqeudBGU8Q9jCHYN8ML+779RQzLjTi78HBvWz4jMxUD6h2/vUL12g4q/mFM0OUw1A==
httpxy@^0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/httpxy/-/httpxy-0.5.2.tgz#b756cd1698b9838106de29775f96ff2b55d79777"
integrity sha512-C5OM92bmywDDdKTuYCGejdNFAb/zy0LX4srimOudYko847HvoWL2Eeik9odh9friPKu/JrlWv4z/amrJoxq2Cg==

husky@9.1.7:
version "9.1.7"
Expand Down
Loading