chore: add request id (#7610)

This commit is contained in:
Mark Kim 2024-06-28 10:32:11 -04:00 committed by GitHub
parent eab0e9c675
commit cb25910198
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,6 @@
import { getApiBaseURL, getClientString, INSOMNIA_FETCH_TIME_OUT, PLAYWRIGHT } from '../common/constants';
import { generateId } from '../common/misc';
interface FetchConfig {
method: 'POST' | 'PUT' | 'GET' | 'DELETE' | 'PATCH';
@ -19,6 +20,7 @@ export async function insomniaFetch<T = void>({ method, path, data, sessionId, o
headers: {
...headers,
'X-Insomnia-Client': getClientString(),
'insomnia-request-id': generateId('desk'),
'X-Origin': origin || getApiBaseURL(),
...(sessionId ? { 'X-Session-Id': sessionId } : {}),
...(data ? { 'Content-Type': 'application/json' } : {}),