angular - 加载资源失败:服务器响应状态为 403
问题描述
我正在使用Github的 Firestorage / Firebase 教程项目。项目描述在这里。
看来是精心设计的,所以我猜问题是我自己的无知。
使用我的 GMail 凭据登录后,我遇到以下错误,并且我的头像图像未显示:
Initiator: platform-browser.js:1213
GET https://lh5.googleusercontent.com/-vz7Fxnqe9Mo/AAAAAAAAAAI/AAAAAAAAAAA/AMZuucnJJZ_Itph8fgRsQrR9saxjY1RytQ/s96-c/photo.jpg
Error 403
当我想显示用户的 GMail 头像时会发生这种情况。
即使在隐身浏览器窗口中,我也可以导航到此图像,所以我不明白为什么我的应用程序无法显示它。
我认为它与 Firestorage 无关,但无论如何我都会在这里发布我的 Firestorage 规则:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if true;
}
}
}
我在 http://localhost:4200/ 本地运行项目
在 Firebase 中,我在授权域列表中有“localhost”。
我可以检查什么来追踪问题?
解决方案
It seems that localhost doesn't work here.
Once deployed on my server, it worked fine.
Would be nice to know what the problem is though.
推荐阅读
- python-3.x - Python 3 包的常规结构是什么?
- mysql - 特定条件的 SQL 查询
- c++ - 嵌套类的类内朋友是否可以访问外部类成员?
- reactjs - 使用 React i18next 我必须使用 withTranslation 吗?
- javascript - 如何在返回之前修改此 qr 函数输出
- flutter - 如何在 Flutter 中自定义我的相机?
- sql - varchar 转换为 datetime 类型
- c# - 如何在 ASP.NET CORE 2.1 API 的 AddAuthentication() 中使用多个 Aws Cognito 用户池
- apache-spark - Spark SQL 窗口顺序的行为
- android - 如何将 Linphone 与 Android SIP 堆栈结合使用