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 object args to support "follow-redirects" #541

Merged
merged 2 commits into from
Mar 30, 2024

Conversation

kettanaito
Copy link
Member

No description provided.

@@ -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 }
Copy link
Member Author

Choose a reason for hiding this comment

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

The actual fix.

@kettanaito
Copy link
Member Author

@mikicho, thanks for fixing this! Can you please give this a quick review to be sure I moved all the changes correctly?

@@ -274,7 +274,7 @@ it('handles [RequestOptions, callback] input', () => {
expect(url.href).toEqual('https://mswjs.io/resource')

// Request options must be preserved.
expect(options).toEqual(initialOptions)
expect(options).toMatchObject(initialOptions)
Copy link
Member Author

Choose a reason for hiding this comment

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

With the fix, the actual options object will contain more things, like _defaultAgent. I suppose I good thing!

@mikicho
Copy link
Contributor

mikicho commented Mar 30, 2024

LGTM

@kettanaito kettanaito merged commit 3348dd7 into feat/yet-another-socket-interceptor Mar 30, 2024
1 check passed
@kettanaito kettanaito deleted the fix/follow-redirects branch March 30, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants