File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,15 @@ function migrateConfig (ipfsd) {
183
183
if ( CURRENT_REVISION < 3 ) {
184
184
const api = config . API || { }
185
185
const httpHeaders = api . HTTPHeaders || { }
186
- const accessControlAllowOrigin = httpHeaders [ 'Access-Control-Allow-Origin' ] || [ ]
186
+ let accessControlAllowOrigin = httpHeaders [ 'Access-Control-Allow-Origin' ] || [ ]
187
+
188
+ // Ensure accessControlAllowOrigin is an array
189
+ if ( ! Array . isArray ( accessControlAllowOrigin ) ) {
190
+ // Convert string to array, or create empty array for other types
191
+ accessControlAllowOrigin = typeof accessControlAllowOrigin === 'string'
192
+ ? [ accessControlAllowOrigin ]
193
+ : [ ]
194
+ }
187
195
188
196
const addURL = url => {
189
197
if ( ! accessControlAllowOrigin . includes ( url ) ) {
You can’t perform that action at this time.
0 commit comments