图片403问题
遇到的问题
在自己写博客的时候,调用了外部链接,想要引用外部图片,结果发现图片引用失败,一开始认为是webp图片格式的问题,后来发现在大佬的提醒下,发现是403的错误,浏览器默认不允许跨域请求,需要自己设置一些东西。
解决方法
在html中的head中加入一条即可。
<meta name="referrer" content="no-referrer"/>
全部内容如下,下列是我的docsify的index.html的head。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="referrer" content="no-referrer"/>
<title>博客</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
</head>

浙公网安备 33010602011771号