{"id":10967,"date":"2023-08-29T23:53:49","date_gmt":"2023-08-29T15:53:49","guid":{"rendered":"https:\/\/www.zhangxinxu.com\/wordpress\/?p=10967"},"modified":"2023-08-29T23:53:49","modified_gmt":"2023-08-29T15:53:49","slug":"web-referer-image-policy","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2023\/08\/web-referer-image-policy\/","title":{"rendered":"Web referrer\u7b56\u7565\u8be6\u89e3\u4e0e\u9632\u76d7\u94fe\u56fe\u7247\u7684\u663e\u793a"},"content":{"rendered":"<p>by <a href=\"https:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=10967\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=10967<\/a> \u946b\u7a7a\u95f4-\u946b\u751f\u6d3b<br \/>\n\u672c\u6587\u6b22\u8fce\u5206\u4eab\u4e0e\u805a\u5408\uff0c\u5168\u6587\u8f6c\u8f7d\u5c31\u4e0d\u5fc5\u4e86\uff0c\u5c0a\u91cd\u7248\u6743\uff0c\u5708\u5b50\u5c31\u8fd9\u4e48\u5927\uff0c\u82e5\u6025\u7528\u53ef\u4ee5\u8054\u7cfb\u6388\u6743\u3002<\/p>\n<p><script>window.wxShareImgUrl = 'https:\/\/www.zhangxinxu.com\/study\/image\/share\/202308-referrer.png';<\/script><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202308\/referrer-cover.png\" width=\"359\" height=\"227\" alt=\"\u905b\u72d7\u5c01\u9762\u56fe\" class=\"alignright clip thumb size-medium\" \/><\/p>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u597d\u597d\u8bb2\u8bb2Web\u4e2d\u7684referrer\u7b56\u7565\uff0c\u4ee5\u53ca\u4e00\u4e9b\u5e94\u7528\u3002<\/p>\n<h3>\u4e00\u3001\u4ecedocument.referrer\u8bf4\u8d77<\/h3>\n<p>document.referrer\u53ef\u4ee5\u83b7\u53d6\u9875\u9762\u7684\u6765\u6e90\u4fe1\u606f\u3002<\/p>\n<p>\u5728\u79fb\u52a8\u7aef\uff0c\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u6b64\u5c5e\u6027\u503c\u662f\u5426\u4e3a\u7a7a\uff0c\u6765\u51b3\u5b9a\u5de6\u4e0a\u89d2\u7684\u6309\u94ae\u662f\u8fd4\u56de\u8fd8\u662f\u56de\u5230\u9996\u9875\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"\/\/image.zhangxinxu.com\/image\/blog\/201702\/2017-02-13_213032.png\" width=\"380\" height=\"141\" alt=\"\u8fd4\u56de\u4e0a\u4e00\u9875\u622a\u56fe\u793a\u610f\" class=\"alignnone\"><\/p>\n<p>\u5173\u4e8e\u8fd9\u4e2a\uff0c\u4e4b\u524d<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2017\/02\/js-page-url-document-referrer\/\">\u6709\u64b0\u6587\u4ecb\u7ecd\u8fc7<\/a>\uff0c\u516d\u5e74\u524d\u7684\u6587\u7ae0\u3002<\/p>\n<p>\u4e0d\u8fc7\u5f53\u65f6\u53ea\u662f\u6d45\u5c1d\u8f84\u6b62\uff0c\u5e76\u6ca1\u6709\u6df1\u5165\u5177\u4f53\u7684referrer\u7b56\u7565\uff0c\u8fd9\u4e00\u6b21\uff0c\u597d\u597d\u8bf4\u8bf4\u8fd9\u4e2a\u4e8b\u60c5\u3002<\/p>\n<p>\u7136\u540e\uff0creferrer\u7b56\u7565\u670d\u52a1\u7aef\u4e5f\u662f\u53ef\u4ee5\u8bbe\u7f6e\u7684\uff0c\u4f46\u672c\u6587\u4ec5\u4ec5\u8ba8\u8bba\u524d\u7aef\u90e8\u5206\u7684\u6280\u672f\u5b9e\u73b0\u3002<\/p>\n<h3>\u4e8c\u3001\u5177\u4f53\u7684referrer\u7b56\u7565<\/h3>\n<p>\u5728 HTTP header \u4e2d\u6709\u4e2a\u540d\u4e3aReferrer-Policy\u7684\u72b6\u6001\uff0c\u53ef\u4ee5\u51b3\u5b9a\u76ee\u6807\u9875\u9762\u4e2d<code>document.referrer<\/code>\u7684\u8fd4\u56de\u503c\uff0c\u4ee5\u53ca\u5bf9\u9875\u9762\u4e2d\u5916\u94fe\u8d44\u6e90\u7684\u8bf7\u6c42\u5f71\u54cd\u3002<\/p>\n<pre>Referrer-Policy: no-referrer\r\nReferrer-Policy: no-referrer-when-downgrade\r\nReferrer-Policy: origin\r\nReferrer-Policy: origin-when-cross-origin\r\nReferrer-Policy: same-origin\r\nReferrer-Policy: strict-origin\r\nReferrer-Policy: strict-origin-when-cross-origin\r\nReferrer-Policy: unsafe-url<\/pre>\n<p>\u5404\u4e2a\u652f\u6301\u7684\u503c\u53ca\u5176\u542b\u4e49\u5982\u4e0b\uff1a<\/p>\n<h4>no-referrer<\/h4>\n<p>\u53d1\u9001\u7684\u8bf7\u6c42\u6216\u8c03\u6574\u7684\u9875\u9762\u4e0d\u5305\u62ec\u4efb\u4f55Referer\u4fe1\u606f\u3002<\/p>\n<table border=\"0\" width=\"100%\" class=\"params_table\" cellspacing=\"1\">\n<thead>\n<tr>\n<th>\u5f00\u6e90\u9875\u9762<\/th>\n<th>\u5bfc\u822a\u5230<\/th>\n<th>Referrer\u4f7f\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><em>anywhere<\/em><\/td>\n<td><em>(no referrer)<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>no-referrer-when-downgrade<\/h4>\n<p>\u5f53\u534f\u8bae\u5b89\u5168\u7ea7\u522b\u4fdd\u6301\u4e0d\u53d8\u6216\u63d0\u9ad8\u65f6(HTTP\u2192HTTP, HTTP\u2192HTTPS, HTTPS\u2192HTTPS)\uff0c\u5728Referer\u4e2d\u53d1\u9001\u6e90\u3001\u8def\u5f84\u548c\u67e5\u8be2\u5b57\u7b26\u4e32\uff0c\u4e0b\u964d\u7684\u65f6\u5019(HTTPS\u2192HTTP, HTTPS\u2192file)\u4e0d\u53d1\u9001Referer\u4fe1\u606f\u3002<\/p>\n<table border=\"0\" width=\"100%\" class=\"params_table\" cellspacing=\"1\">\n<thead>\n<tr>\n<th>\u5f00\u6e90\u9875\u9762<\/th>\n<th>\u5bfc\u822a\u5230<\/th>\n<th>Referrer\u4f7f\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><code>https:\/\/example.com\/otherpage<\/code><\/td>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><code>https:\/\/www.zhangxinxu.com\/code><\/td>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><strong>http<\/strong>:\/\/example.com<\/td>\n<td><em>(no referrer)<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>origin<\/h4>\n<p>Referer\u4fe1\u606f\u662f\u6765\u6e90\u9875\u9762URL\u5730\u5740\u4e2d\u7684origin\u4fe1\u606f\uff08location.origin\uff09\u3002<\/p>\n<table border=\"0\" width=\"100%\" class=\"params_table\" cellspacing=\"1\">\n<thead>\n<tr>\n<th>\u5f00\u6e90\u9875\u9762<\/th>\n<th>\u5bfc\u822a\u5230<\/th>\n<th>Referrer\u4f7f\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><em>anywhere<\/em><\/td>\n<td><code>https:\/\/example.com\/<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>origin-when-cross-origin<\/h4>\n<p>\u5982\u679c\u8de8\u57df\uff0cReferer\u53ea\u663e\u793a\u539f\u59cb\u7684\u57df\u4fe1\u606f\u3002<\/p>\n<table border=\"0\" width=\"100%\" class=\"params_table\" cellspacing=\"1\">\n<thead>\n<tr>\n<th>\u5f00\u6e90\u9875\u9762<\/th>\n<th>\u5bfc\u822a\u5230<\/th>\n<th>Referrer\u4f7f\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><code>https:\/\/example.com\/otherpage<\/code><\/td>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><code>https:\/\/zhangxinxu.com<\/code><\/td>\n<td><code>https:\/\/example.com\/<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><strong>http<\/strong>:\/\/example.com\/page<\/td>\n<td><code>https:\/\/example.com\/<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>same-origin<\/h4>\n<p>\u5fc5\u987b\u57df\u540d\u76f8\u540c\uff0c\u5426\u5219Referer\u4fe1\u606f\u4e3a\u7a7a\u3002<\/p>\n<table border=\"0\" width=\"100%\" class=\"params_table\" cellspacing=\"1\">\n<thead>\n<tr>\n<th>\u5f00\u6e90\u9875\u9762<\/th>\n<th>\u5bfc\u822a\u5230<\/th>\n<th>Referrer\u4f7f\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><code>https:\/\/example.com\/otherpage<\/code><\/td>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><code>https:\/\/zhangxinxu.com<\/code><\/td>\n<td><em>(no referrer)<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>strict-origin<\/h4>\n<p>\u4ec5\u5f53\u534f\u8bae\u5b89\u5168\u7ea7\u522b\u4fdd\u6301\u4e0d\u53d8\u65f6\u53d1\u9001Referer\u4fe1\u606f\uff0c\u5426\u5219\u65e0Referer\u4fe1\u606f\u3002<\/p>\n<table border=\"0\" width=\"100%\" class=\"params_table\" cellspacing=\"1\">\n<thead>\n<tr>\n<th>\u5f00\u6e90\u9875\u9762<\/th>\n<th>\u5bfc\u822a\u5230<\/th>\n<th>Referrer\u4f7f\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><code>https:\/\/zhangxinxu.com<\/code><\/td>\n<td><code>https:\/\/example.com\/<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><strong>http<\/strong>:\/\/example.com<\/td>\n<td><em>(no referrer)<\/em><\/td>\n<\/tr>\n<tr>\n<td><strong>http<\/strong>:\/\/example.com\/page<\/td>\n<td><em>anywhere<\/em><\/td>\n<td><code>http:\/\/example.com\/<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>strict-origin-when-cross-origin<span style=\"font-weight:normal;\">\uff08\u9ed8\u8ba4\u503c\uff09<\/span><\/h4>\n<p>\u57df\u540d\u548c\u5b89\u5168\u534f\u8bae\u76f8\u540c\u6216\u66f4\u9ad8\u7684\u65f6\u5019\uff0cReferer\u4fe1\u606f\u662f\u5b8c\u6574\u5730\u5740\uff0c\u5982\u679c\u8de8\u57df\uff0c\u5219Referer\u4fe1\u606f\u662f\u539f\u59cb\u7684\u57df\u4fe1\u606f\uff0c\u5982\u679c\u5b89\u5168\u534f\u8bae\u964d\u4f4e\uff0cReferer\u4fe1\u606f\u4e3a\u7a7a\u3002<\/p>\n<table border=\"0\" width=\"100%\" class=\"params_table\" cellspacing=\"1\">\n<thead>\n<tr>\n<th>\u5f00\u6e90\u9875\u9762<\/th>\n<th>\u5bfc\u822a\u5230<\/th>\n<th>Referrer\u4f7f\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><code>https:\/\/example.com\/otherpage<\/code><\/td>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><code>https:\/\/zhangxinxu.com<\/code><\/td>\n<td><code>https:\/\/example.com\/<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>https:\/\/example.com\/page<\/code><\/td>\n<td><strong>http<\/strong>:\/\/example.com<\/td>\n<td><em>(no referrer)<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>unsafe-url<\/h4>\n<p>\u5c31\u7b97URL\u5730\u5740\u4e0d\u5b89\u5168\uff0c\u4e5f\u53d1\u9001\u5b8c\u6574\u7684Referer\u4fe1\u606f\u3002<\/p>\n<table border=\"0\" width=\"100%\" class=\"params_table\" cellspacing=\"1\">\n<thead>\n<tr>\n<th>\u5f00\u6e90\u9875\u9762<\/th>\n<th>\u5bfc\u822a\u5230<\/th>\n<th>Referrer\u4f7f\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>https:\/\/example.com\/page?q=123<\/code><\/td>\n<td><em>anywhere<\/em><\/td>\n<td><code>https:\/\/example.com\/page?q=123<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5176\u4e2d\uff0c\u90e8\u5206\u8bbf\u95ee\u6765\u6e90\u7b56\u7565\u662f\u6700\u8fd1\u51e0\u5e74\u624d\u6709\u5404\u5927\u73b0\u4ee3\u6d4f\u89c8\u5668\u652f\u6301\u7684\uff0c\u5c24\u5176\u662f\u90a3\u51e0\u4e2a\u5305\u542b\u4e86origin\u7684\u7b56\u7565\u503c\uff0c\u4ee5\u76ee\u524d\u7684\u6d4f\u89c8\u5668\u7248\u672c\u6765\u770b\uff0c\u5927\u5bb6\u65e0\u9700\u62c5\u5fc3\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u653e\u5fc3\u4f7f\u7528\u5373\u53ef\u3002<\/p>\n<h3>\u4e09\u3001referrer\u8bbe\u7f6e\u7684\u51e0\u79cd\u65b9\u6cd5<\/h3>\n<p>\u5728Web\u7f51\u9875\u4e2d\uff0creferrer\u8bbe\u7f6e\u6709\u4e0b\u9762\u4e09\u79cd\u65b9\u6cd5\uff08\u5982\u679c\u8fd8\u6709\u5176\u4ed6\u7684\uff0c\u6b22\u8fce\u8bc4\u8bba\u8865\u5145\uff09\u3002<\/p>\n<h4>1. meta\u8bbe\u7f6e<\/h4>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>&lt;meta name=\"referrer\" content=\"origin\" \/&gt;<\/pre>\n<p>\u6216\u8005<\/p>\n<pre>&lt;meta name=\"referrer\" content=\"no-referrer\" \/&gt;<\/pre>\n<p><code>lt;meta&gt;<\/code>\u5143\u7d20\u7684\u8bbe\u7f6e\u662f\u5f71\u54cd\u6574\u4e2a\u9875\u9762\u7684\u3002<\/p>\n<h4>2. rel\u5c5e\u6027<\/h4>\n<p>rel\u5c5e\u6027\u652f\u6301\u540d\u4e3a<code>noreferrer<\/code>\u7684\u5c5e\u6027\u503c\uff0c\u6ce8\u610f\uff0c\u5176\u4e2d\u6ca1\u6709\u77ed\u6a2a\u7ebf\uff0c\u4e00\u822c\u4f5c\u7528\u5728\u94fe\u63a5\u5143\u7d20\u4e0a\uff0c\u8fd9\u6837\uff0c\u8bbf\u95ee\u6b64\u94fe\u63a5\uff0c\u662f\u4e0d\u4f1a\u643a\u5e26referrer\u4fe1\u606f\u7684\u3002<\/p>\n<pre>&lt;a href=\"https:\/\/www.cssworld.cn\" rel=\"noreferrer\"&gt;\u70b9\u51fb\u6211\u4e0d\u8981\u94b1&lt;\/a&gt;<\/pre>\n<p>rel\u5c5e\u6027\u5176\u5b9e\u652f\u6301\u975e\u5e38\u591a\u7684\u5c5e\u6027\u503c\uff0c\u6709\u5174\u8da3\u4e86\u89e3\u7684\uff0c\u53ef\u4ee5\u53c2\u89c1\u6211\u4e4b\u524d\u7684\u8fd9\u7bc7\u6587\u7ae0\uff1a\u201c<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2019\/06\/html-a-link-rel\/\">HTML rel\u5c5e\u6027\u503c\u91ca\u4e49\u5927\u5168<\/a>\u201d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202308\/image-rel.png\" width=\"717\" height=\"351\" alt=\"rel\u652f\u6301\u7684\u5c5e\u6027\u503c\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u4e0d\u8fc7rel\u5c5e\u6027\u53ea\u80fd\u8bbe\u7f6enoreferrer\u8fd9\u4e00\u4e2a\u7b56\u7565\uff0c\u5982\u679c\u5e0c\u671b\u8bbe\u7f6e\u5176\u4ed6\u5c5e\u6027\u503c\uff0c\u8fd8\u9700\u8981\u4f7f\u7528\u4e13\u95e8\u7684HTML\u5c5e\u6027-referrerpolicy\u3002<\/p>\n<pre>&lt;a href=\"https:\/\/www.cssworld.cn\" referrerpolicy=\"same-origin\"&gt;\u70b9\u51fb\u6211\u7684\u5582&lt;\/a&gt;\r\n&lt;a href=\"https:\/\/www.cssworld.cn\" referrerpolicy=\"origin-when-cross-origin\"&gt;\u70b9\u51fb\u6211+1&lt;\/a&gt;<\/pre>\n<p>\u773c\u89c1\u4e3a\u5b9e\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/study\/202308\/html-referrerpolicy-demo.php\" rel=\"noopener\" target=\"_blank\">HTML referrerpolicy\u5c5e\u6027\u6d4b\u8bd5demo <\/a><\/p>\n<p>\u70b9\u51fbdemo\u9875\u9762\u7b2c\u4e00\u4e2a\u94fe\u63a5\uff0c\u5728\u76ee\u6807\u9875\u9762\u7684\u63a7\u5236\u53f0\u8f93\u5165document.referrer\uff0c\u53ef\u4ee5\u770b\u5230\u662f\u7a7a\u5b57\u7b26\u4e32\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202308\/2023-08-29_230504.png\" width=\"254\" height=\"125\" alt=\"\u94fe\u63a5\u70b9\u51fb\u793a\u610f\" class=\"alignnone size-medium\" \/> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202308\/2023-08-29_230211.png\" width=\"315\" height=\"195\" alt=\"\u4e3a\u7a7a\u793a\u610f\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u56e0\u4e3a\u8981\u6c42\u8bbf\u95ee\u9875\u9762\u5730\u5740\u548c\u539f\u9875\u9762\u540c\u6e90\uff08\u540c\u57df\u540d\uff09\u3002<\/p>\n<p>\u4f46\u662f\u70b9\u51fb\u4e0b\u9762\u4e00\u4e2a\u94fe\u63a5\uff0c\u5219document.referrer\u5219\u6709\u503c\uff0c\u4e14\u662f\u4e4b\u524d\u9875\u9762\u7684\u534f\u8bae+\u57df\u540d\u4fe1\u606f\uff0c\u56e0\u4e3a<code>origin-when-cross-origin<\/code>\u7684\u610f\u601d\u5c31\u662f\uff0c\u8de8\u57df\u7684\u65f6\u5019\uff0c\u4ec5\u663e\u793a\u57df\u540d\u4fe1\u606f\uff0c\u800c\u975e\u4e4b\u524d\u9875\u9762\u7684\u5b8c\u6574URL\u8def\u5f84\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202308\/2023-08-29_230257.png\" width=\"281\" height=\"182\" alt=\"\u663e\u793a\u7684\u57df\u4fe1\u606f\" class=\"alignnone size-medium\" \/><\/p>\n<h3>\u56db\u3001\u5e94\u7528\u4e4b\u663e\u793a\u9632\u76d7\u94fe\u56fe\u7247<\/h3>\n<p>\u5f88\u591a\u7f51\u7ad9\uff0c\u4e3a\u4e86\u907f\u514d\u56fe\u7247\u88ab\u5916\u7ad9\u5f15\u7528\uff0c\u4f1a\u5f00\u542f\u9632\u76d7\u94fe\u3002<\/p>\n<p>\u800c\u9632\u76d7\u94fe\u7684\u539f\u7406\uff08\u6709\u4e9b\u7f51\u7ad9\u5e76\u4e0d\u662f\uff09\u5c31\u662f\u901a\u8fc7HTTP_REFERER\u5224\u65ad\u57df\u540d\u6765\u6e90\uff0c\u800c\u505a\u4e0d\u540c\u7684\u5904\u7406\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u5982\u679c\u5e0c\u671b\u8ba9\u81ea\u5df1\u7684\u7f51\u7ad9\u53ef\u4ee5\u663e\u793a\u67d0\u4e9b\u5916\u7ad9\u7684\u7684\u56fe\u7247\uff0c\u53ef\u4ee5\u901a\u8fc7\u4f2a\u9020REFERER\u5934\u4fe1\u606f\uff0c\u6216\u8005\u76f4\u63a5\u5173\u95edREFERER\u4fe1\u606f\u6765\u5b9e\u73b0\u3002<\/p>\n<p>\u5e38\u7528\u7684\u4e14\u6bd4\u8f83\u7b80\u5355\u7684\u4e00\u79cd\u505a\u6cd5\u5c31\u662f\u4f7f\u7528 <code>&lt;meta&gt;<\/code> \u5143\u7d20\u3002<\/p>\n<pre>&lt;meta name=\"referrer\" content=\"never\"&gt;<\/pre>\n<p>\u6b64\u65f6\uff0c\u539f\u672c403\u7684\u56fe\u7247\u8bf4\u4e0d\u5b9a\u5c31\u53ef\u4ee5\u6b63\u5e38200\u663e\u793a\u4e86\u3002<\/p>\n<h3>\u4e94\u3001\u7ed3\u8bed\u8bf4\u660e<\/h3>\n<p>OK\uff0c\u57fa\u672c\u4e0a\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u8981\u8bf4\u7684\u5185\u5bb9\u4e86\u3002<\/p>\n<p>Web\u4e2d\u7684\u77e5\u8bc6\u90fd\u662f\u6210\u4f53\u7cfb\u7684\uff0c\u8d2f\u7a7f\u524d\u7aef\u540e\u7aef\uff0c\u5c31\u50cfreferrer\u8fd9\u6837\u4e00\u4e2a\u57fa\u7840\u7684\u77e5\u8bc6\u70b9\uff0c\u7275\u626f\u5230HTML\u5c5e\u6027\uff0cJS API\uff0cHTTP\u534f\u8bae\u5934\uff0c\u670d\u52a1\u5668\u914d\u7f6e\uff0cWeb\u5b89\u5168\u7b49\u8bf8\u591a\u65b9\u9762\u7684\u77e5\u8bc6\u3002<\/p>\n<p>\u4e00\u4e2a\u770b\u4f3c\u7b80\u5355\u7684HTML\u5c5e\u6027\u7684\u5e95\u4e0b\uff0c\u53ef\u80fd\u662f\u4e00\u5ea7\u5de8\u5927\u7684\u51b0\u5c71\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u9762\u5bf9\u77e5\u8bc6\uff0c\u9762\u5bf9\u5b66\u4e60\uff0c\u8981\u65f6\u523b\u8c26\u900a\uff0c\u6d77\u7eb3\u767e\u5ddd\u6709\u5bb9\u4e43\u5927\u3002<\/p>\n<p>\u597d\uff0c\u611f\u8c22\u5927\u5bb6\u7684\u9605\u8bfb\uff0c\u6b22\u8fce<button onclick=\"shareWeixin.click()\" class=\"entry-share-btn\">\u5206\u4eab<\/button>\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202308\/2023-08-29_234047.png\" width=\"115\" height=\"76\" alt=\"\u5fae\u7b11\u7f8e\u5973\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u6b22\u8fce\u5206\u4eab\uff0c\u52ff\u5168\u6587\u8f6c\u8f7d\uff0c\u5982\u679c\u5b9e\u5728\u559c\u6b22\uff0c\u53ef\u6536\u85cf\uff0c\u6c38\u4e0d\u8fc7\u671f\uff0c\u4e14\u4f1a\u53ca\u65f6\u66f4\u65b0\u77e5\u8bc6\u70b9\u53ca\u4fee\u6b63\u9519\u8bef\uff0c\u9605\u8bfb\u4f53\u9a8c\u4e5f\u66f4\u597d\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=10967\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=10967<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202308\/referrer-cover.png\" width=\"160\" height=\"101\" alt=\"\u905b\u72d7\u5c01\u9762\u56fe\" class=\"alignright size-medium\" loading=\"lazy\" \/><\/p>\n<p>\u4e00\u4e2a\u770b\u4f3c\u7b80\u5355\u7684HTML\u5c5e\u6027\u7684\u5e95\u4e0b\uff0c\u53ef\u80fd\u662f\u4e00\u5ea7\u5de8\u5927\u7684\u51b0\u5c71\uff0creferrer\u53ca\u5176\u76f8\u5173\u7279\u6027\u5c31\u662f\u5982\u6b64\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[1216,982,1432,1098,1942,1411],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/10967"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=10967"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/10967\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=10967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=10967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=10967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}