Skip to content

Commit

Permalink
Changing collectionDomain to edgeDomain
Browse files Browse the repository at this point in the history
  • Loading branch information
mliljenb committed Jun 3, 2019
1 parent 01e5e19 commit f056487
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/core/configValidators.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { required, validDomain } from "../utils/config-validators";

export default {
propertyID: { validate: required },
collectionDomain: {
edgeDomain: {
validate: validDomain,
defaultValue: "edgegateway.azurewebsites.net"
},
Expand Down
4 changes: 2 additions & 2 deletions src/core/network/createNetwork.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default (config, logger, lifecycle, networkStrategy) => {
.catch(e => logger.warn(e));
};

const { collectionDomain, propertyID } = config;
const { edgeDomain, propertyID } = config;
return {
/**
* The object returned from network.newRequest
Expand All @@ -44,7 +44,7 @@ export default (config, logger, lifecycle, networkStrategy) => {
newRequest(isBeacon = false) {
const payload = createPayload();
const action = isBeacon ? "collect" : "interact";
const url = `https://${collectionDomain}/${action}?propertyID=${propertyID}`;
const url = `https://${edgeDomain}/${action}?propertyID=${propertyID}`;
const deferred = defer();
const responsePromise = deferred.promise
.then(() =>
Expand Down
8 changes: 4 additions & 4 deletions test/unit/core/configValidators.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ describe("configValidators", () => {
{ propertyID: "myproperty1" },
{
propertyID: "myproperty1",
collectionDomain: "stats.firstparty.com"
edgeDomain: "stats.firstparty.com"
},
{ propertyID: "myproperty1", collectionDomain: "STATS.FIRSTPARY.COM" }
{ propertyID: "myproperty1", edgeDomain: "STATS.FIRSTPARY.COM" }
];

const invalidConfigurations = [
{},
{ propertyID: "myproperty1", collectionDomain: "" },
{ propertyID: "myproperty1", collectionDomain: "stats firstparty.com" }
{ propertyID: "myproperty1", edgeDomain: "" },
{ propertyID: "myproperty1", edgeDomain: "stats firstparty.com" }
];

validConfigurations.forEach((config, i) => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/core/network/createNetwork.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import createNetwork from "../../../../src/core/network/createNetwork";

describe("createNetwork", () => {
const config = {
collectionDomain: "alloy.mysite.com",
edgeDomain: "alloy.mysite.com",
propertyID: "mypropertyid"
};

Expand Down

0 comments on commit f056487

Please sign in to comment.