Skip to content

Commit

Permalink
fix(export): only set authorization header if token exists
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Jun 7, 2022
1 parent cf0a809 commit 7956379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@sanity/export/src/AssetHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class AssetHandler {
const isImage = assetDoc._type === 'sanity.imageAsset'

const url = parseUrl(assetDoc.url, true)
if (isImage && ['cdn.sanity.io', 'cdn.sanity.work'].includes(url.hostname)) {
if (isImage && ['cdn.sanity.io', 'cdn.sanity.work'].includes(url.hostname) && token) {
headers.Authorization = `Bearer ${token}`
url.query = {...(url.query || {}), dlRaw: 'true'}
}
Expand Down

3 comments on commit 7956379

@vercel
Copy link

@vercel vercel bot commented on 7956379 Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

studio-workshop – ./dev/workshop

studio-workshop.sanity.build
studio-workshop-git-next.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 7956379 Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

test-studio – ./

test-studio-git-next.sanity.build
test-studio.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 7956379 Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

perf-studio – ./

perf-studio.sanity.build
perf-studio-git-next.sanity.build

Please sign in to comment.