Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
bbindreiter committed Nov 29, 2023
2 parents a9dde73 + af47eaf commit 7ec775d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/alexa-remote-ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,16 @@ class AlexaRemoteExt extends AlexaRemote {
// proxy status message is not the final callback call
// it is also not an actual error
// so we filter it out and report it our own way
const begin = `You can try to get the cookie manually by opening http://`;
const end = `/ with your browser.`;
const beginIdx = err.message.indexOf(begin);
const endIdx = err.message.indexOf(end);

if (beginIdx !== -1 && endIdx !== -1) {
const url = err.message.substring(begin.length, endIdx);
const bypassError1 = /^You can try to get the cookie manually by opening https?:\/\/(.*)\/ with your browser\.$/;
const bypassError2 = /^Please open https?:\/\/(.*)\/ with your browser and login to Amazon\. The cookie will be output here after successfull login\.$/;
const matchError1 = bypassError1.exec(err.message);
const matchError2 = bypassError2.exec(err.message);

if (matchError1 || matchError2) {
// const url = matchError1 && matchError1[1] || matchError2 && matchError2[1];
const url = `http://${config.proxyOwnIp}:${config.proxyPort}`;
proxyActiveCallback(url);
}
else {
} else {
reject(err);
}
}
Expand Down

0 comments on commit 7ec775d

Please sign in to comment.