Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

fix: getCurrentSessions for cloud providers using Basic Auth #1693

Merged

Conversation

huzaifaiftikhar
Copy link
Contributor

  1. The "Attach to session" tab of the inspector app doesn't return the running sessions for BrowserStack, this happens because the BrowserStack APIs require the user credentials otherwise it returns a response code of 401.
  2. This PR adds the Authorization header for the /wd/hub/sessions requests i.e. for getCurrentSessions
  3. Also add the ability to use the BROWSERSTACK_PORT set in the environment variables for defining the port and setting SSL to true if the port is 443.

@huzaifaiftikhar
Copy link
Contributor Author

@KazuCocoa I need a review on this PR as well, it's similar to the other one except that it's forked out of 1.20 branch so that we can release this with Appium Desktop v1.20

try {
const res = await request(`http${ssl ? 's' : ''}://${host}:${port}${appiumPath}/sessions`);
if (username && accessKey) {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made these changes

@KazuCocoa KazuCocoa merged commit bcee0f7 into appium:1.20 Feb 15, 2021
@KazuCocoa
Copy link
Member

thanks!

@huzaifaiftikhar huzaifaiftikhar deleted the fix_attach_to_session_for_browserstack branch February 15, 2021 07:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants