我上传到私有Azure blob存储的资产的预览未显示在strapi Jmeter 板中

ltskdhd1  于 2023-06-24  发布在  其他
关注(0)|答案(1)|浏览(142)

[在此处输入图像描述][1]将文件上传到我的私有Azure blob存储后,我上传的资源的预览未显示在Strapi Jmeter 板中。我正在使用我的存储访问密钥向Strapi提供权限。我能够通过Strapi Jmeter 板上传和删除文件,但预览和下载不可用。任何快速的帮助将不胜感激。为此挣扎了几天。
下面是我在middleware.js中使用的Strapi代码

name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          "connect-src": ["'self'", "https:"],
          "img-src": [
            "'self'",
            "data:",
            "blob:",
            "dl.airtable.com",
            "https://market-assets.strapi.io",
            "https://*.blob.core.windows.net",
            "https://*.blob.core.windows.net/my_bucket_name",
          ],
          "media-src": [
            "'self'",
            "data:",
            "blob:",
            "dl.airtable.com",
            "https://*.blob.core.windows.net",
            "https://*.blob.core.windows.net/my_bucket_name",
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },```

Below is the configuration where I am giving permission access to Strapi for Azure

```upload: {
      config: {
        provider: 'strapi-provider-upload-azure-storage',
        providerOptions: {
          account: env('STORAGE_ACCOUNT'),
          accountKey: env('STORAGE_ACCOUNT_KEY'),
          serviceBaseURL: env('STORAGE_URL'),
          containerName: env('STORAGE_CONTAINER_NAME'),
          defaultPath: 'assets',
          maxConcurrent: 100,
          expiresIn:3600,
        }
      }
    },```
[Below is the link where you can find the image][1]

  [1]: https://i.stack.imgur.com/xhZrN.png
v440hwme

v440hwme1#

MSDoc为Slapi。

代码:

account: env("STORAGE_ACCOUNT"),
        accountKey: env("STORAGE_ACCOUNT_KEY"),
        serviceBaseURL: env("STORAGE_URL"), // optional
        containerName: env("STORAGE_CONTAINER_NAME"),
        defaultPath: "assets",
        cdnBaseURL: env("STORAGE_CDN_URL")
"media-src": [
            "'self'",
            "data:",
            "blob:",
            "dl.airtable.com",
            /**
 * Note: If using a STORAGE_URL replace `https://${process.env.STORAGE_ACCOUNT}.blob.core.windows.net` w/ process.env.STORAGE_URL
 * If using a CDN URL make sure to include that url in the CSP headers process.env.STORAGE_CDN_URL
 */
            `https://${process.env.STORAGE_ACCOUNT}.blob.core.windows.net`,

          ],
          upgradeInsecureRequests: null,
  • 请确保在应用程序的相应路径中的文件夹。
    输出:

相关问题