pull/715/head
Travis Fischer 2025-06-12 07:14:52 +07:00
rodzic 259f988f52
commit 45fd347ee3
2 zmienionych plików z 27 dodań i 2 usunięć

Wyświetl plik

@ -632,12 +632,23 @@ export const fixtureSuites: E2ETestFixtureSuite[] = [
snapshot: false,
fixtures: [
{
path: '@dev/test-everything-openapi/echo_headers',
path: '@dev/test-everything-openapi@ee3b9fdc/echo_headers',
response: {
validate: (body) => {
expect(body['x-agentic-proxy-secret']).toEqual(
'f279280a67a15df6e0245511bdeb11854fc8f6f702c49d028431bb1dbc03bfdc'
)
expect(body['x-agentic-deployment-id']).toEqual(
'depl_yhc7f8gubcqycagjp68c4ozr'
)
expect(body['x-agentic-deployment-identifier']).toEqual(
'@dev/test-everything-openapi@ee3b9fdc'
)
expect(body['x-agentic-is-customer-subscription-active']).toEqual(
'false'
)
expect(body['x-agentic-user-id']).toBeUndefined()
expect(body['x-agentic-customer-id']).toBeUndefined()
}
}
}

Wyświetl plik

@ -66,13 +66,17 @@ export function updateOriginRequest(
consumer.stripeStatus
)
originRequest.headers.set('x-agentic-user', consumer.user.id)
originRequest.headers.set('x-agentic-user-id', consumer.user.id)
originRequest.headers.set('x-agentic-user-email', consumer.user.email)
originRequest.headers.set('x-agentic-user-username', consumer.user.username)
originRequest.headers.set(
'x-agentic-user-created-at',
consumer.user.createdAt
)
originRequest.headers.set(
'x-agentic-user-updated-at',
consumer.user.updatedAt
)
if (consumer.plan) {
originRequest.headers.set(
@ -84,6 +88,11 @@ export function updateOriginRequest(
if (consumer.user.name) {
originRequest.headers.set('x-agentic-user-name', consumer.user.name)
}
} else {
originRequest.headers.set(
'x-agentic-is-customer-subscription-active',
'false'
)
}
// TODO: this header is causing some random upstream cloudflare errors
@ -94,5 +103,10 @@ export function updateOriginRequest(
originRequest.headers.set('cache-control', cacheControl)
}
originRequest.headers.set('x-agentic-deployment-id', deployment.id)
originRequest.headers.set(
'x-agentic-deployment-identifier',
deployment.identifier
)
originRequest.headers.set('x-agentic-proxy-secret', deployment._secret)
}