New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloudflare R2 对象存储显示图片的时候 400 bad request,文字和上传图片是可以的 #2436
Comments
Title: Cloudflare R2 object storage gets 400 bad request when displaying images, text and uploaded images are OK |
Maybe there's something wrong with your Cloudflare configurations, I suggest you to check that first. |
@athurg Thank you for your reply, I tried the Cloudflare R2 configurations but it failed. So CORS can not be blamed. I tried to access the object file in Chrome, and there is some response like the following image. It seems that R2 S3 API is not supporting this way to access, the So I checked the memos R2 storage configuration, and I found that I missed the URL prefix configuration when checking the screenshot of document. However, according to Cloudflare, it is not a good idea for product use. And it still not working, I don't know what does it mean of Can memos support customized domain public access configuration for R2? And I tested it successfully by adding customized javascript to auto-replace the image URL. Of course, it's testing, the code can be more elegant when it is in the backend. function refresher() {
setTimeout(function () {
for (item of document.getElementsByClassName('mt-2')) {
for (img of item.getElementsByTagName('img')) {
if (img.src.startsWith('https://img.edony.ink/memos')) continue;
img.setAttribute('src', 'https://img.edony.ink/memos/' + img.src.split('/')[img.src.split('/').length - 1]);
}
}
}, 1500)
}
setInterval(function () {
refresher();
}, 30000) |
it seems that it is R2 access problem not memos and close the issue. |
Describe the bug
如下图所示,配置好 R2 存储之后,添加图片,然后查看记录发现获取图片失败。
Steps to reproduce
Screenshots or additional context
No response
The text was updated successfully, but these errors were encountered: