fix(storage-*): client uploads with disablePayloadAccessControl: true (#11530)
Fixes https://github.com/payloadcms/payload/issues/11473 Previously, when `disablePayloadAccessControl: true` was defined, client uploads were working improperly. The reason is that `addDataAndFileToRequest` expects `staticHandler` to be defined and we don't add in case if `disablePayloadAccessControl: true`. This PR makes it so otherwise and if we have `clientUploads`, it pushes the "proxied" handler that responses only when the file was requested in the context of client upload (from `addDataAndFileToRequest`)
This commit is contained in:
@@ -141,6 +141,7 @@ function uploadthingInternal(options: UploadthingStorageOptions): Adapter {
|
||||
|
||||
return (): GeneratedAdapter => {
|
||||
const {
|
||||
clientUploads,
|
||||
options: { acl = 'public-read', ...utOptions },
|
||||
} = options
|
||||
|
||||
@@ -148,6 +149,7 @@ function uploadthingInternal(options: UploadthingStorageOptions): Adapter {
|
||||
|
||||
return {
|
||||
name: 'uploadthing',
|
||||
clientUploads,
|
||||
fields,
|
||||
generateURL,
|
||||
handleDelete: getHandleDelete({ utApi }),
|
||||
|
||||
Reference in New Issue
Block a user