@vivinkv28/strapi-provider-uploadthing 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +36 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -87,6 +87,42 @@ export default ({ env }) => ({
87
87
  });
88
88
  ```
89
89
 
90
+ Update `./config/middlewares.ts` as well so Strapi's Content Security Policy allows UploadThing-hosted files to load in the admin and media library:
91
+
92
+ ```ts
93
+ import type { Core } from '@strapi/strapi';
94
+
95
+ const config: Core.Config.Middlewares = [
96
+ 'strapi::logger',
97
+ 'strapi::errors',
98
+ {
99
+ name: 'strapi::security',
100
+ config: {
101
+ contentSecurityPolicy: {
102
+ useDefaults: true,
103
+ directives: {
104
+ 'connect-src': ["'self'", 'https:'],
105
+ 'img-src': ["'self'", 'data:', 'blob:', 'https://*.ufs.sh', 'https://utfs.io'],
106
+ 'media-src': ["'self'", 'data:', 'blob:', 'https://*.ufs.sh', 'https://utfs.io'],
107
+ upgradeInsecureRequests: null,
108
+ },
109
+ },
110
+ },
111
+ },
112
+ 'strapi::cors',
113
+ 'strapi::poweredBy',
114
+ 'strapi::query',
115
+ 'strapi::body',
116
+ 'strapi::session',
117
+ 'strapi::favicon',
118
+ 'strapi::public',
119
+ ];
120
+
121
+ export default config;
122
+ ```
123
+
124
+ If you already have a `strapi::security` middleware entry, merge these UploadThing domains into your existing CSP directives instead of duplicating the middleware.
125
+
90
126
  ## Provider Options
91
127
 
92
128
  | Option | Type | Default | Description |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vivinkv28/strapi-provider-uploadthing",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "UploadThing provider for the Strapi Upload plugin",
5
5
  "main": "index.js",
6
6
  "exports": {