Skip to content

Commit

Permalink
Fixed domain comprobation during check() method, causing a fail compr…
Browse files Browse the repository at this point in the history
…obation when having a TLD and subdomains from the same TLD
  • Loading branch information
juanpablob committed Oct 22, 2015
1 parent 06a58ec commit e227242
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/angular-environment.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* angular-environment Plugin
*
* An useful plugin that gives you an opportunity to set up different information
* An useful plugin that allows you to set up different information
* such as api endpoints, urls, variables, etc, based on the context of scripts execution:
* development, stage, production or any other custom environment you want to create.
*
Expand Down Expand Up @@ -82,12 +82,12 @@ angular.module('environment', []).
* @return {Void}
*/
this.check = function() {
var hostname = window.location.hostname,
var location = window.location.href,
self = this;

angular.forEach(this.data.domains, function(v, k) {
angular.forEach(v, function(v) {
if (hostname.search(v) !== -1) {
if (location.match('//' + v)) {
self.environment = k;
}
});
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-environment.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/angular-environment.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* angular-environment Plugin
*
* An useful plugin that gives you an opportunity to set up different information
* An useful plugin that allows you to set up different information
* such as api endpoints, urls, variables, etc, based on the context of scripts execution:
* development, stage, production or any other custom environment you want to create.
*
Expand Down Expand Up @@ -82,12 +82,12 @@ angular.module('environment', []).
* @return {Void}
*/
this.check = function() {
var hostname = window.location.hostname,
var location = window.location.href,
self = this;

angular.forEach(this.data.domains, function(v, k) {
angular.forEach(v, function(v) {
if (hostname.search(v) !== -1) {
if (location.match('//' + v)) {
self.environment = k;
}
});
Expand Down

0 comments on commit e227242

Please sign in to comment.