我目前在谷歌云平台存储桶中为我的网站托管一些静态 .css、.js、.tff 和图像资源。上传这些资源后,我最多可以访问这些资源大约 20 分钟。大约 20 分钟后,当我尝试访问它们时收到 401 错误消息:
{"error":{"errors":[{"domain":"global","reason":"lockedDomainExpired","message":"Locked Domain Expired"}],"code":401,"message":"Locked Domain Expired"}}
来自 GCP 网站:
lockedDomainExpired: When downloading content from a cookie-authenticated site, e.g., using the Storage Browser, the response will redirect to a temporary domain. This error will occur if access to said domain occurs after the domain expires. Issue the original request again, and receive a new redirect.
在我尝试使用 GCP 存储桶的背景下,我不太确定这意味着什么?任何帮助或资源将不胜感激。
最佳答案
当您在开发人员控制台中单击指向某个对象的链接时,它会生成一个仅在短时间内有效的 URL。我怀疑您是将此 URL 复制到您的网站,而不是使用可公开访问的 URL。
假设对象是公开可读的,您应该能够改用这种 URL 格式。
https://storage.googleapis.com/<bucket>/<object>
关于google-app-engine - 谷歌云平台存储错误 : "Locked Domain Expired" when trying to access my storage items,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45390150/