You've already forked pages
forked from didirus/AstralRinth
fix: add x-panel-version header (#4855)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { AuthFeature, TauriModrinthClient } from '@modrinth/api-client'
|
||||
import { AuthFeature, PanelVersionFeature, TauriModrinthClient } from '@modrinth/api-client'
|
||||
import {
|
||||
ArrowBigUpDashIcon,
|
||||
ChangeSkinIcon,
|
||||
@@ -115,6 +115,7 @@ const tauriApiClient = new TauriModrinthClient({
|
||||
new AuthFeature({
|
||||
token: async () => (await getCreds()).session,
|
||||
}),
|
||||
new PanelVersionFeature(),
|
||||
],
|
||||
})
|
||||
provideModrinthClient(tauriApiClient)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { PANEL_VERSION } from '@modrinth/api-client'
|
||||
import type { V1ErrorInfo } from '@modrinth/utils'
|
||||
import { ModrinthServerError, ModrinthServersFetchError } from '@modrinth/utils'
|
||||
import { $fetch, FetchError } from 'ofetch'
|
||||
@@ -103,6 +104,7 @@ export async function useServersFetch<T>(
|
||||
const headers: Record<string, string> = {
|
||||
'User-Agent': 'Modrinth/1.0 (https://modrinth.com)',
|
||||
'X-Archon-Request': 'true',
|
||||
'X-Panel-Version': String(PANEL_VERSION),
|
||||
Vary: 'Accept, Origin',
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
NuxtCircuitBreakerStorage,
|
||||
type NuxtClientConfig,
|
||||
NuxtModrinthClient,
|
||||
PanelVersionFeature,
|
||||
VerboseLoggingFeature,
|
||||
} from '@modrinth/api-client'
|
||||
import type { Ref } from 'vue'
|
||||
@@ -31,6 +32,7 @@ export function createModrinthClient(
|
||||
maxFailures: 3,
|
||||
resetTimeout: 30000,
|
||||
}),
|
||||
new PanelVersionFeature(),
|
||||
...optionalFeatures,
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user