瀏覽代碼

@uppy/companion-client: treat `*` the same as missing header (#4221)

Setting `Access-Control-Allow-Headers: *` should be interpreted as
when that header is missing, for backward compat.
Antoine du Hamel 2 年之前
父節點
當前提交
92a0b20a43
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/@uppy/companion-client/src/RequestClient.js

+ 1 - 1
packages/@uppy/companion-client/src/RequestClient.js

@@ -115,7 +115,7 @@ export default class RequestClient {
         const response = await fetch(this.#getUrl(path), { method: 'OPTIONS' })
 
         const header = response.headers.get('access-control-allow-headers')
-        if (header == null) {
+        if (header == null || header === '*') {
           allowedHeadersCache.set(this.hostname, fallbackAllowedHeaders)
           return fallbackAllowedHeaders
         }