diff --git a/apps/api/src/modules/workshop/workshop-client.test.ts b/apps/api/src/modules/workshop/workshop-client.test.ts index 137896f..5b7ed3a 100644 --- a/apps/api/src/modules/workshop/workshop-client.test.ts +++ b/apps/api/src/modules/workshop/workshop-client.test.ts @@ -120,6 +120,21 @@ describe('localizedLabel', () => { }); describe('WorkshopClient (v2)', () => { + it('identifies panel traffic to the upstream API', async () => { + const { client: workshop, fetchImpl } = client(() => listResponse()); + await workshop.search({}); + + expect(fetchImpl).toHaveBeenCalledWith( + expect.any(String), + expect.objectContaining({ + headers: expect.objectContaining({ + 'User-Agent': 'reforger.dzr.tools', + 'X-API-Client': 'reforger.dzr.tools', + }), + }), + ); + }); + it('maps search results with typed sizes and ratings', async () => { const { client: workshop, fetchImpl } = client(() => listResponse()); const result = await workshop.search({ diff --git a/apps/api/src/modules/workshop/workshop-client.ts b/apps/api/src/modules/workshop/workshop-client.ts index f628bd8..e3f6359 100644 --- a/apps/api/src/modules/workshop/workshop-client.ts +++ b/apps/api/src/modules/workshop/workshop-client.ts @@ -32,7 +32,7 @@ import { ApiError } from '../../lib/errors.js'; */ /** Identifies the panel to the upstream, as its docs request. */ -const CLIENT_NAME = 'reforger-panel'; +const CLIENT_NAME = 'reforger.dzr.tools'; // ---------- upstream schemas ----------