Skip to content
Merged
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
3 changes: 2 additions & 1 deletion device/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,8 @@ function DeviceClient(options) {
}

if (!isUndefined(options.host) && isUndefined(options.region)) {
var pattern = /[a-zA-Z0-9]+\.iot\.([a-z]+-[a-z]+-[0-9]+)\.amazonaws\..+/;
// extract anything in between "iot" and "amazonaws" as region
var pattern = /[a-zA-Z0-9]+\.iot\.([^\.]+)\.amazonaws\..+/;
var region = pattern.exec(options.host);
if (region === null) {
console.log('Host endpoint is not valid');
Expand Down
Loading