fix(ui): bundle the footer's ZenQuality logo (production CSP img-src 'self' refused the hotlink); CSP proof counts every violation; gitleaks allowlist carries the owner's [gated 2026-10-18] marker
This commit is contained in:
1 parent
1814a8d7d7
commit
dcc79400de
7 files changed
+163
-17
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
@@ -1,6 +1,9 @@
|
||||
import { useConfig } from '@/app/providers/ConfigProvider'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import pawsInHarmonyUrl from '@/assets/brand/paws-in-harmony.svg?url'
|
||||
// Bundled copy of zenquality.fr/assets/logo-horizontal-1024.png: the
|
||||
// production CSP (`img-src 'self' data: blob:`) refuses an external image.
|
||||
import zenQualityUrl from '@/assets/brand/zenquality-logo-horizontal.png?url'
|
||||
|
||||
export default function Footer() {
|
||||
const cfg = useConfig()
|
||||
@@ -22,7 +25,7 @@ export default function Footer() {
|
||||
className="inline-flex items-center"
|
||||
>
|
||||
<img
|
||||
src="https://zenquality.fr/assets/logo-horizontal-1024.png"
|
||||
src={zenQualityUrl}
|
||||
alt="ZenQuality"
|
||||
className="h-6 w-auto"
|
||||
loading="lazy"
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import Footer from '@/components/brand/Footer'
|
||||
|
||||
// The production CSP is `img-src 'self' data: blob:` (DEPLOY.md): every
|
||||
// footer image must be served by the application itself (R4.10j, the
|
||||
// ZenQuality logo was hotlinked from zenquality.fr and refused).
|
||||
describe('Footer', () => {
|
||||
it('serves every image from the application, never an external host', () => {
|
||||
render(<Footer />)
|
||||
const sources = screen.getAllByRole('img').map((img) => img.getAttribute('src'))
|
||||
expect(sources).toHaveLength(2)
|
||||
for (const src of sources) {
|
||||
expect(src).toMatch(/^\/|^data:|^blob:/)
|
||||
expect(src).not.toMatch(/^https?:/)
|
||||
}
|
||||
})
|
||||
|
||||
it('keeps the credit links', () => {
|
||||
render(<Footer />)
|
||||
expect(screen.getByRole('link', { name: 'ZenQuality' })).toHaveAttribute(
|
||||
'href',
|
||||
'https://zenquality.fr',
|
||||
)
|
||||
expect(screen.getByRole('link', { name: 'Paws in Harmony' })).toHaveAttribute(
|
||||
'href',
|
||||
'https://www.instagram.com/paws.iin.harmony',
|
||||
)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user