Skip to content

Commit

Permalink
refactor: use util to format headers
Browse files Browse the repository at this point in the history
  • Loading branch information
RihanArfan committed Oct 28, 2024
1 parent abdfe8e commit e259098
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { joinURL } from 'ufo'
import { defu } from 'defu'
import { $fetch } from 'ofetch'
import { addDevToolsCustomTabs } from './utils/devtools'
import { getCloudflareAccessHeaders } from './runtime/utils/cloudflareAccess'

const log = logger.withTag('nuxt:hub')
const { resolve, resolvePath } = createResolver(import.meta.url)
Expand Down Expand Up @@ -337,10 +338,7 @@ export async function setupRemote(_nuxt: Nuxt, hub: HubConfig) {
baseURL: hub.projectUrl as string,
headers: {
authorization: `Bearer ${hub.projectSecretKey || hub.userToken}`,
...(hub.cloudflareAccess?.clientId && hub.cloudflareAccess?.clientSecret && {
'CF-Access-Client-Id': hub.cloudflareAccess?.clientId,
'CF-Access-Client-Secret': hub.cloudflareAccess?.clientSecret
})
...getCloudflareAccessHeaders(hub.cloudflareAccess)
}
})
.catch(async (err) => {
Expand Down

0 comments on commit e259098

Please sign in to comment.