Simplify relay request headers
CI / test (pull_request) Has been cancelled

This commit is contained in:
2026-06-24 03:52:16 +09:00
parent 1f6e228272
commit 6503bb1b76
8 changed files with 23 additions and 68 deletions
+4 -4
View File
@@ -15,7 +15,7 @@ type TwitterClientPrivate = TwitterClient & {
refreshQueryIds: () => Promise<void>;
fetchWithTimeout: (url: string, init: RequestInit) => Promise<ResponseLike>;
ensureClientUserId: () => Promise<void>;
getBaseHeaders: () => Record<string, string>;
getHeaders: () => Record<string, string>;
fetchUserArticlePlainText: (userId: string, tweetId: string) => Promise<{ title?: string; plainText?: string }>;
fetchTweetDetail: (tweetId: string) => Promise<{ success: true } | { success: false; error: string }>;
postStatusUpdate: (input: { text: string }) => Promise<{ success: boolean; error?: string }>;
@@ -108,7 +108,7 @@ describe('TwitterClient core coverage', () => {
expect(result.error).toBe('Tweet not found in response');
});
it('adds client user id header after ensureClientUserId', async () => {
it('does not add Twitter headers after ensureClientUserId', async () => {
const client = new TwitterClient({ relayBaseUrl: testRelayBaseUrl });
process.env.NODE_ENV = 'production';
@@ -119,9 +119,9 @@ describe('TwitterClient core coverage', () => {
const clientPrivate = client as unknown as TwitterClientPrivate;
await clientPrivate.ensureClientUserId();
const headers = clientPrivate.getBaseHeaders();
const headers = clientPrivate.getHeaders();
expect(headers['x-twitter-client-user-id']).toBe('42');
expect(headers).toEqual({});
});
describe('fetchUserArticlePlainText failures', () => {