diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/http/headers/timing-allow-origin/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/http/headers/timing-allow-origin/index.html')
-rw-r--r-- | files/zh-cn/web/http/headers/timing-allow-origin/index.html | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/files/zh-cn/web/http/headers/timing-allow-origin/index.html b/files/zh-cn/web/http/headers/timing-allow-origin/index.html new file mode 100644 index 0000000000..4c34e30120 --- /dev/null +++ b/files/zh-cn/web/http/headers/timing-allow-origin/index.html @@ -0,0 +1,78 @@ +--- +title: Timing-Allow-Origin +slug: Web/HTTP/Headers/Timing-Allow-Origin +translation_of: Web/HTTP/Headers/Timing-Allow-Origin +--- +<div>{{HTTPSidebar}}</div> + +<p>响应头<code><strong>Timing-Allow-Origin</strong></code>用于指定特定站点,以允许其访问<a href="/en-US/docs/Web/API/Resource_Timing_API">Resource Timing API</a>提供的相关信息,否则这些信息会由于跨源限制将被报告为零</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">Header type</th> + <td>{{Glossary("Response header")}}</td> + </tr> + <tr> + <th scope="row">{{Glossary("Forbidden header name")}}</th> + <td>no</td> + </tr> + </tbody> +</table> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox">Timing-Allow-Origin: * +Timing-Allow-Origin: <origin>[, <origin>]* +</pre> + +<h2 id="指令">指令</h2> + +<dl> + <dt>*</dt> + <dd>服务器可以以“<code>*</code>”作为通配符,从而允许所有域都具有访问定时信息的权限。</dd> + <dt><origin></dt> + <dd>指定一个可以访问资源的URI。你也可以通过逗号隔开,指定多个URI。</dd> +</dl> + +<h2 id="示例">示例</h2> + +<p>如需允许任何资源都可以看到的计时(timing)信息,你可以如此设置:</p> + +<pre>Timing-Allow-Origin: * +</pre> + +<p>如需允许<code>https://developer.mozilla.org</code>查看你的计时信息,你可以设置:</p> + +<pre>Timing-Allow-Origin: https://developer.mozilla.org</pre> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('Resource Timing 3', '#timing-allow-origin', 'Timing-Allow-Origin')}}</td> + <td>{{Spec2("Resource Timing 3")}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("http.headers.Timing-Allow-Origin")}}</p> + +<h2 id="参见">参见</h2> + +<ul> + <li><a href="/en-US/docs/Web/API/Resource_Timing_API">Resource Timing API</a></li> + <li><a href="/en-US/docs/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API">Using the Resource Timing API</a></li> + <li>{{HTTPHeader("Vary")}}</li> +</ul> |