Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/components/Readme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,11 @@ function handleClick(event: MouseEvent) {
z-index: 1;
}

/* With defined width, height will be automatically calculated using the aspect ratio */
.readme :deep(img[width]) {
height: auto;
}

.readme :deep(video) {
height: revert-layer;
display: revert-layer;
Expand Down
10 changes: 5 additions & 5 deletions server/utils/image-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export const TRUSTED_IMAGE_DOMAINS = [
'npmx.dev',

// GitHub (already proxied by GitHub's own camo)
// We do not include github.com and user-images.githubusercontent.com because they
// might return redirects to s3 which will be blocked by the CSP
'raw.githubusercontent.com',
'github.com',
'user-images.githubusercontent.com',
'avatars.githubusercontent.com',
'repository-images.githubusercontent.com',
'github.githubassets.com',
Expand Down Expand Up @@ -69,6 +69,7 @@ export const TRUSTED_IMAGE_DOMAINS = [
'deepwiki.com',
'saucelabs.github.io',
'opencollective.com',
'images.opencollective.com',
'circleci.com',
'www.codetriage.com',
'badges.gitter.im',
Expand All @@ -86,9 +87,8 @@ export function isTrustedImageDomain(url: string): boolean {
if (!parsed?.hostname) return false

const hostname = parsed.hostname.toLowerCase()
return TRUSTED_IMAGE_DOMAINS.some(
domain => hostname === domain || hostname.endsWith(`.${domain}`),
)
// We only look at exact matches (not subdomains), since the same array is used as a check in CSP
return TRUSTED_IMAGE_DOMAINS.includes(hostname)
}

/**
Expand Down
Loading