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(ClientRequest): spread ClientRequest object argument to fix "follow-redirects" #540

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export function normalizeClientRequestArgs(
// Handle a given "RequestOptions" object as-is
// and derive the URL instance from it.
else if (isObject(args[0])) {
options = args[0] as any
options = { ... args[0] as any }
logger.info('first argument is RequestOptions:', options)

// When handling a "RequestOptions" object without an explicit "protocol",
Expand Down
2 changes: 1 addition & 1 deletion test/third-party/follow-redirect-http.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ afterAll(async () => {
await server.close()
})

it.skip('intercepts a POST request issued by "follow-redirects"', async () => {
it('intercepts a POST request issued by "follow-redirects"', async () => {
const { address } = server.https
const payload = JSON.stringify({ todo: 'Buy the milk' })

Expand Down
Loading