CSP: img-src

The HTTP Content-Security-Policy: img-src 지시어는 이미지 및 파비콘에 대하여 유효한 출처를 지정합니다.

CSP version 1
Directive type Fetch directive (en-US)
default-src fallback Yes. If this directive is absent, the user agent will look for the default-src directive.

Syntax

img-src 정책에 대해 하나 이상의 출처를 허용 할 수 있습니다.

Content-Security-Policy: img-src <source>;
Content-Security-Policy: img-src <source> <source>;

Sources

<source> can be any one of the values listed in CSP Source Values (en-US).

Note that this same set of values can be used in all fetch directives (en-US) (and a number of other directives (en-US)).

Examples

Violation cases

CSP 헤더가 주어질 때:

Content-Security-Policy: img-src https://example.com/

아래의 <img> 태그가 차단되어 불러오지 않습니다:

<img src="https://not-example.com/foo.jpg" alt="example picture">

Specifications

Browser compatibility

No compatibility data found for http.headers.csp.img-src.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.

See also