This commit is contained in:
@@ -54,7 +54,12 @@ async function api<T = any>(endpoint: string, options: RequestInit = {}): Promis
|
||||
const { headers: customHeaders, ...rest } = options;
|
||||
const res = await fetch(`${API_URL}${endpoint}`, {
|
||||
...rest,
|
||||
headers: { 'Content-Type': 'application/json', ...(customHeaders as Record<string, string>) },
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
// Plays an up-to-date terminal app, so the minimum app version never refuses it
|
||||
'X-App-Version': process.env.APP_VERSION || '999.0.0',
|
||||
...(customHeaders as Record<string, string>),
|
||||
},
|
||||
});
|
||||
if (!res.ok) {
|
||||
const body = await res.json().catch(() => null);
|
||||
|
||||
Reference in New Issue
Block a user