Skip to content

When providing cdnUrl, default segmentHost value is used #202

@ichikareman2

Description

@ichikareman2

When providing config like this:

{
  apiKey: 'test-api-key',
  cdnURL: 'https://www.test.com'
  debug: !production
}

the cdnURL is left unused and segmentHost default value, cdn.segment.com is used instead.

I think it's because segmentHost is checked first and it has a default value so if unprovided it will still have a value and the if condition will always be true.

if (this._config.segmentHost) {
  // Deprecated option
  cdnUrl = 'https://' + this._config.segmentHost;
} else {
  cdnUrl = this._config.cdnURL;
}

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions