Skip to content

Commit 6b7cd7e

Browse files
committed
fix: use ofetch-fetch for external urls
1 parent 4474e6e commit 6b7cd7e

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

app/composables/useConnector.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { PendingOperation, OperationStatus, OperationType } from '../../cli/src/types'
2+
import { $fetch } from 'ofetch'
23

34
export interface NewOperation {
45
type: OperationType

server/plugins/fetch-cache.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { H3Event } from 'h3'
22
import type { CachedFetchEntry, CachedFetchResult } from '#shared/utils/fetch-cache-config'
3+
import { $fetch } from 'ofetch'
34
import {
45
FETCH_CACHE_DEFAULT_TTL,
56
FETCH_CACHE_STORAGE_BASE,

server/utils/docs/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99

1010
import { doc, type DocNode } from '@deno/doc'
11+
import { $fetch } from 'ofetch'
1112
import type { DenoDocNode, DenoDocResult } from '#shared/types/deno-doc'
1213

1314
// =============================================================================
@@ -163,7 +164,7 @@ async function getTypesUrl(packageName: string, version: string): Promise<string
163164

164165
try {
165166
const response = await $fetch.raw(url, {
166-
method: 'HEAD',
167+
method: 'HEAD' as 'GET', // Cast to satisfy Nitro's typed $fetch (external URL, any method is fine)
167168
timeout: FETCH_TIMEOUT_MS,
168169
})
169170
return response.headers.get('x-typescript-types')

0 commit comments

Comments
 (0)