-
Notifications
You must be signed in to change notification settings - Fork 0
Directive: img src
Ryan Parman edited this page Jun 14, 2024
·
8 revisions
The img-src
directive specifies valid sources of images and favicons.
Affects: <img>; <link rel=icon>; <picture> → <source>
Required reading:
Accepts one or more schemes or hosts, the 'self'
keyword, or the 'none'
keyword.
img-src 'none'
img-src 'self'
img-src example.com
img-src example.com example.org
img-src https://*.example.com
img-src https:
✅ img-src
will fallback to default-src
if it is undefined.
-
CSP-0100 — [ERROR] directive
%s
has an invalid value%s
ABNF (CSP3)
directive-name = "img-src"
directive-value = serialized-source-list
See ABNF: serialized-source-list
- source-list in CSP2
- serialized-source-list in CSP3
Content licensed under CC BY-SA.
- 🧪 Experimental, with limited support
⚠️ Important notes on usage- 🚫 Deprecated or obsolete
- base-uri
- block-all-mixed-content 🚫
- child-src
- connect-src
- default-src
- fenced-frame-src 🧪
- font-src
- form-action
- frame-ancestors
- frame-src
- img-src
- manifest-src
- media-src
- navigate-to 🚫
- object-src
- plugin-types 🚫
- prefetch-src 🚫
- referrer 🚫
- report-to 🧪
-
report-uri
⚠️ - require-trusted-types-for 🧪
- sandbox
- script-src-attr
- script-src-elem
- script-src
- style-src-attr
- style-src-elem
- style-src
- trusted-types 🧪
- upgrade-insecure-requests
- webrtc
- worker-src