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: HTTP request agent does not change on protocol change. #4286

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

garg3133
Copy link
Member

When the keep-alive property of the webdriver config is set to true, Nightwatch uses the same HTTP agent for all the requests made during the entirety of the test run (a feature that was added in PR #3748).

This led to an issue where if we needed to switch to a different protocol (between https and https) for certain requests during the test run, those requests would fail due to an invalid agent and gave out the following error:

✖ TypeError
   Error while trying to create HTTP request for "/wd/hub/session/765c4e2a8c629d29ce778b2886bfef5d6634e050/url": Protocol "http:" not supported. Expected "https:"

This PR fixes this by allowing the agent to be changed whenever the protocol for the request changes.

Copy link

Status

  • ❌ No modified files found in the types directory.
    Please make sure to include types for any changes you have made. Thank you!.

@garg3133 garg3133 merged commit 6a41f47 into nightwatchjs:main Oct 25, 2024
17 checks passed
@garg3133 garg3133 deleted the browserstack-keepalive branch October 25, 2024 18:11
@garg3133 garg3133 changed the title fix: HTTP request agent not changes on protocol change. fix: HTTP request agent does not change on protocol change. Nov 9, 2024
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.

1 participant