我正在将我的 SVG 文件上传到本地运行在 Docker 中的 Minio 服务器。
const uploadedFile = await client.putObject(bucketName, filename, readStream);
然后我会生成一个公共URL,例如 http://localhost:9000/link-identifiers/example.svg
,我可以从那里公开下载文件。
如果我想像这样在浏览器中显示它 <img src={picUrl}>
,图片根本无法渲染。
我在浏览器中获得了这些响应头:
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 124775
Content-Security-Policy: block-all-mixed-content
Content-Type: application/octet-stream
ETag: "109be6a37b9091e50651b3cbbe6bed3a"
Last-Modified: Wed, 02 Sep 2020 06:44:28 GMT
Server: MinIO/RELEASE.2020-08-07T01-23-07Z
Vary: Origin
X-Amz-Request-Id: 1630E4E87DF71408
X-Xss-Protection: 1; mode=block
Date: Wed, 02 Sep 2020 06:52:34 GMT
为了使图片渲染,我需要对minio服务器进行其他配置吗? 如果我能够下载它们并且查看时它们是完好无损的,那么它们也应该能够在浏览器中呈现,不是吗?
目前bucket的权限设置为public
,具体如下:
mc policy set public myminio/link-identifiers