Merge origin/main into overhaul
Both sides added upstream client-identification headers independently. Keep the overhaul's client (caching now lives in workshop-cache.ts, so the in-client preview cache and its TTL are gone) and adopt origin's identity string 'reforger.dzr.tools'. Origin's header test is kept, retargeted from the removed health() onto search(). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iyv7BRFwX5nGqY5uV91Uu
This commit is contained in:
2 files changed
+16
-1
No files matched your search
@@ -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({
|
||||
|
||||
@@ -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 ----------
|
||||
|
||||
|
||||
Reference in new issue
Block a user