Skip to content

Commit

Permalink
πŸ›βœ… fix e2e intake forwarding to datadog
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitZugmeyer committed Feb 7, 2023
1 parent 3b4ac18 commit aaa8d95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/e2e/lib/framework/serverApps/intake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async function forwardReplayToIntake(req: express.Request): Promise<any> {

function prepareIntakeRequest(req: express.Request) {
const ddforward = req.query.ddforward! as string
if (!/^https:\/\/(session-replay|rum|logs)\.browser-intake-datadoghq\.com\//.test(ddforward)) {
if (!/^\/api\/v2\//.test(ddforward)) {
throw new Error(`Unsupported ddforward: ${ddforward}`)
}
const options = {
Expand All @@ -147,7 +147,7 @@ function prepareIntakeRequest(req: express.Request) {
'User-Agent': req.headers['user-agent'],
},
}
return https.request(ddforward, options)
return https.request(new URL(ddforward, 'https://browser-intake-datadoghq.com'), options)
}

async function readStream(stream: NodeJS.ReadableStream): Promise<Buffer> {
Expand Down

0 comments on commit aaa8d95

Please sign in to comment.