Skip to content

Commit fd2f7d8

Browse files
committed
Match regex match beginning of location.href only
The match string will find any occurrences of a string in the location.href. There a possibility a different environment is present later in the string and that will be matched incorrectly.
1 parent 7ce0f2c commit fd2f7d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/angular-environment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ angular.module('environment', []).
8787

8888
angular.forEach(this.data.domains, function(v, k) {
8989
angular.forEach(v, function(v) {
90-
if (location.match('//' + v)) {
90+
if (location.match(new RegExp("^http(s)?:\/\/" + v))) {
9191
self.environment = k;
9292
}
9393
});

0 commit comments

Comments
 (0)