From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/glossary/fetch_directive/index.html | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 files/zh-cn/glossary/fetch_directive/index.html (limited to 'files/zh-cn/glossary/fetch_directive') diff --git a/files/zh-cn/glossary/fetch_directive/index.html b/files/zh-cn/glossary/fetch_directive/index.html new file mode 100644 index 0000000000..c05d352f44 --- /dev/null +++ b/files/zh-cn/glossary/fetch_directive/index.html @@ -0,0 +1,44 @@ +--- +title: Fetch 指令 +slug: Glossary/Fetch_directive +tags: + - CSP + - HTTP + - 安全 +translation_of: Glossary/Fetch_directive +--- +

{{Glossary("CSP")}} fetch 指令用在{{HTTPHeader("Content-Security-Policy")}} 头部中,可以用来控制某些具体类型的资源可以从哪些来源被加载。比如说, {{CSP("script-src")}} 使得开发者可以允许可信任来源的脚本在页面上执行, {{CSP("font-src")}} 可以控制字体的来源。

+ +

所有的指令的值都会回落到 {{CSP("default-src")}}。也就是说,如果某个fetch指令在CSP头部中未定义, 那么用户代理就会寻找default-src 指令的值来替代。

+ +

这些 CSP 指令属于fetch指令:

+ + + +
+

了解更多

+ + +
-- cgit v1.2.3-54-g00ecf