diff --git a/packages/core/src/domain/configuration.spec.ts b/packages/core/src/domain/configuration.spec.ts index 8e4063aa01..be1fe9e864 100644 --- a/packages/core/src/domain/configuration.spec.ts +++ b/packages/core/src/domain/configuration.spec.ts @@ -62,34 +62,27 @@ describe('configuration', () => { describe('sdk_version, env, version and service', () => { it('should not modify the logs and rum endpoints tags when not defined', () => { const configuration = buildConfiguration({ clientToken }, usEnv) - expect(decodeURIComponent(configuration.rumEndpoint)).toContain(`&ddtags=sdk_version:${usEnv.sdkVersion}`) + expect(configuration.rumEndpoint).toContain(`&ddtags=sdk_version:${usEnv.sdkVersion}`) - expect(decodeURIComponent(configuration.rumEndpoint)).not.toContain(',env:') - expect(decodeURIComponent(configuration.rumEndpoint)).not.toContain(',service:') - expect(decodeURIComponent(configuration.rumEndpoint)).not.toContain(',version:') - expect(decodeURIComponent(configuration.logsEndpoint)).not.toContain(',env:') - expect(decodeURIComponent(configuration.logsEndpoint)).not.toContain(',service:') - expect(decodeURIComponent(configuration.logsEndpoint)).not.toContain(',version:') + expect(configuration.rumEndpoint).not.toContain(',env:') + expect(configuration.rumEndpoint).not.toContain(',service:') + expect(configuration.rumEndpoint).not.toContain(',version:') + expect(configuration.logsEndpoint).not.toContain(',env:') + expect(configuration.logsEndpoint).not.toContain(',service:') + expect(configuration.logsEndpoint).not.toContain(',version:') }) it('should be set as tags in the logs and rum endpoints', () => { const configuration = buildConfiguration({ clientToken, env: 'foo', service: 'bar', version: 'baz' }, usEnv) - expect(decodeURIComponent(configuration.rumEndpoint)).toContain( + expect(configuration.rumEndpoint).toContain( `&ddtags=sdk_version:${usEnv.sdkVersion},env:foo,service:bar,version:baz` ) - expect(decodeURIComponent(configuration.logsEndpoint)).toContain( + expect(configuration.logsEndpoint).toContain( `&ddtags=sdk_version:${usEnv.sdkVersion},env:foo,service:bar,version:baz` ) }) }) - describe('tags', () => { - it('should be encoded', () => { - const configuration = buildConfiguration({ clientToken, service: 'bar+foo' }, usEnv) - expect(configuration.rumEndpoint).toContain(`ddtags=sdk_version%3Asome_version%2Cservice%3Abar%2Bfoo`) - }) - }) - describe('cookie options', () => { it('should not be secure nor crossSite by default', () => { const configuration = buildConfiguration({ clientToken }, usEnv) diff --git a/packages/core/src/domain/configuration.ts b/packages/core/src/domain/configuration.ts index de44086719..a95a4071f2 100644 --- a/packages/core/src/domain/configuration.ts +++ b/packages/core/src/domain/configuration.ts @@ -246,9 +246,7 @@ function getEndpoint( const host = conf.proxyHost ? conf.proxyHost : datadogHost const proxyParameter = conf.proxyHost ? `ddhost=${datadogHost}&` : '' const applicationIdParameter = conf.applicationId ? `_dd.application_id=${conf.applicationId}&` : '' - const parameters = `${applicationIdParameter}${proxyParameter}ddsource=${ - source || 'browser' - }&ddtags=${encodeURIComponent(tags)}` + const parameters = `${applicationIdParameter}${proxyParameter}ddsource=${source || 'browser'}&ddtags=${tags}` return `https://${host}/v1/input/${conf.clientToken}?${parameters}` }