Skip to content

Commit

Permalink
fix: wrong events path for clientSideID
Browse files Browse the repository at this point in the history
  • Loading branch information
LaunchDarklyReleaseBot committed Aug 26, 2023
1 parent cada2f6 commit 37bdbf4
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/shared/sdk-server/src/events/EventSender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,12 @@ export default class EventSender implements subsystem.LDEventSender {
...defaultHeaders(sdkKey, config, info),
};

this.eventsUri = `${events}/bulk`;
const isClientSideID = !sdkKey.startsWith('sdk-');
this.eventsUri = isClientSideID ? `${events}/events/bulk/${sdkKey}` : `${events}/bulk`;
this.diagnosticEventsUri = isClientSideID
? `${events}/events/diagnostic/${sdkKey}`
: `${events}/diagnostic`;

// edge sdks use clientSideID so we use the environment endpoint
const useEnvironmentEndpoint = !sdkKey.startsWith('sdk-');
if (useEnvironmentEndpoint) {
this.eventsUri = `${this.eventsUri}/${sdkKey}`;
}

this.diagnosticEventsUri = `${events}/diagnostic`;
this.requests = requests;
this.crypto = crypto;
}
Expand Down

0 comments on commit 37bdbf4

Please sign in to comment.