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

fix: we can redirect disturbed request body if it's not going to be used #3873

Merged
merged 5 commits into from
Nov 23, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixup
ronag committed Nov 23, 2024
commit 548988968a75a7d2136d89de048ad6d863f165e7
13 changes: 5 additions & 8 deletions lib/handler/redirect-handler.js
Original file line number Diff line number Diff line change
@@ -49,7 +49,6 @@ class RedirectHandler {
this.maxRedirections = maxRedirections
this.handler = handler
this.history = []
this.redirectionLimitReached = false

if (util.isStream(this.opts.body)) {
// TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
@@ -101,9 +100,7 @@ class RedirectHandler {

onHeaders (statusCode, rawHeaders, resume, statusText) {
if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {
this.redirectionLimitReached = true
this.abort(new Error('max redirects'))
return
throw new Error('max redirects')
}

// https://tools.ietf.org/html/rfc7231#section-6.4.2
@@ -127,14 +124,14 @@ class RedirectHandler {
this.opts.body = null
}

if (this.opts.origin) {
this.history.push(new URL(this.opts.path, this.opts.origin))
}

this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
? null
: parseLocation(statusCode, rawHeaders)

if (this.opts.origin) {
this.history.push(new URL(this.opts.path, this.opts.origin))
}

if (!this.location) {
return this.handler.onHeaders(statusCode, rawHeaders, resume, statusText)
}

Unchanged files with check annotations Beta

'use strict'

Check failure on line 1 in test/redirect-request.js

GitHub Actions / test (23, ubuntu-latest) / Test with Node.js 23 on ubuntu-latest

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / test (21, ubuntu-latest) / Test with Node.js 21 on ubuntu-latest

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / test (20, macos-latest) / Test with Node.js 20 on macos-latest

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / test (18, macos-latest) / Test with Node.js 18 on macos-latest

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms', code: 'ERR_TEST_FAILURE' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / test (20, ubuntu-latest) / Test with Node.js 20 on ubuntu-latest

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / test (22, ubuntu-latest) / Test with Node.js 22 on ubuntu-latest

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / Test with Node.js 20 compiled --without-intl

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / Test with Node.js 22 compiled --without-intl

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / test (18, ubuntu-latest) / Test with Node.js 18 on ubuntu-latest

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms', code: 'ERR_TEST_FAILURE' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / test (22, macos-latest) / Test with Node.js 22 on macos-latest

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / test (23, macos-latest) / Test with Node.js 23 on macos-latest

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / test (21, macos-latest) / Test with Node.js 21 on macos-latest

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }

Check failure on line 1 in test/redirect-request.js

GitHub Actions / Test with Node.js 23 compiled --without-intl

test/redirect-request.js

[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }
const { tspl } = require('@matteo.collina/tspl')
const { test, after } = require('node:test')
const body = await bodyStream.text()
t.strictEqual(statusCode, 301)

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (23, ubuntu-latest) / Test with Node.js 23 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (23, ubuntu-latest) / Test with Node.js 23 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (23, ubuntu-latest) / Test with Node.js 23 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (21, ubuntu-latest) / Test with Node.js 21 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:640:9) at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (21, ubuntu-latest) / Test with Node.js 21 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:640:9) at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (21, ubuntu-latest) / Test with Node.js 21 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:640:9) at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (20, macos-latest) / Test with Node.js 20 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:797:9) at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (20, macos-latest) / Test with Node.js 20 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:797:9) at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (20, macos-latest) / Test with Node.js 20 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:797:9) at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (18, macos-latest) / Test with Node.js 18 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:632:9) at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' }, code: 'ERR_TEST_FAILURE' }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (18, macos-latest) / Test with Node.js 18 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:632:9) at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' }, code: 'ERR_TEST_FAILURE' }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (18, macos-latest) / Test with Node.js 18 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:632:9) at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' }, code: 'ERR_TEST_FAILURE' }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (20, ubuntu-latest) / Test with Node.js 20 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:797:9) at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (20, ubuntu-latest) / Test with Node.js 20 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:797:9) at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (20, ubuntu-latest) / Test with Node.js 20 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:797:9) at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (22, ubuntu-latest) / Test with Node.js 22 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (22, ubuntu-latest) / Test with Node.js 22 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (22, ubuntu-latest) / Test with Node.js 22 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / Test with Node.js 20 compiled --without-intl

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:797:9) at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / Test with Node.js 20 compiled --without-intl

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:797:9) at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / Test with Node.js 20 compiled --without-intl

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:797:9) at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / Test with Node.js 22 compiled --without-intl

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / Test with Node.js 22 compiled --without-intl

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / Test with Node.js 22 compiled --without-intl

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (18, ubuntu-latest) / Test with Node.js 18 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:632:9) at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' }, code: 'ERR_TEST_FAILURE' }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (18, ubuntu-latest) / Test with Node.js 18 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:632:9) at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' }, code: 'ERR_TEST_FAILURE' }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (18, ubuntu-latest) / Test with Node.js 18 on ubuntu-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:632:9) at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' }, code: 'ERR_TEST_FAILURE' }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (22, macos-latest) / Test with Node.js 22 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (22, macos-latest) / Test with Node.js 22 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (22, macos-latest) / Test with Node.js 22 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (23, macos-latest) / Test with Node.js 23 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (23, macos-latest) / Test with Node.js 23 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (23, macos-latest) / Test with Node.js 23 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (21, macos-latest) / Test with Node.js 21 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:640:9) at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (21, macos-latest) / Test with Node.js 21 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:640:9) at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / test (21, macos-latest) / Test with Node.js 21 on macos-latest

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:640:9) at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / Test with Node.js 23 compiled --without-intl

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / Test with Node.js 23 compiled --without-intl

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }

Check failure on line 515 in test/redirect-request.js

GitHub Actions / Test with Node.js 23 compiled --without-intl

should not follow redirects when using Readable request bodies

[Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: 200 !== 301 ] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 200 !== 301 at res.<computed> [as strictEqual] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/redirect-request.js:515:7) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:935:9) at async Test.processPendingSubtests (node:internal/test_runner/test:633:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 200, expected: 301, operator: 'strictEqual' } }
t.strictEqual(headers.location, `http://${server}/301/1`)
t.strictEqual(body.length, 0)
await t.completed