mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix headers type check in Sandbox SDK request function (#21746)
* Fix headers type check in sandbox request function * Add changeset
This commit is contained in:
5
.changeset/modern-keys-confess.md
Normal file
5
.changeset/modern-keys-confess.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@directus/api": patch
|
||||
---
|
||||
|
||||
Fixed the type check for `headers` in the Sandbox SDK request function
|
||||
@@ -51,8 +51,8 @@ export function requestGenerator(requestedScopes: ExtensionSandboxRequestedScope
|
||||
throw new TypeError('Request body has to be of type string or object');
|
||||
}
|
||||
|
||||
if (headers !== undefined && headers.typeof !== 'undefined' && headers.typeof !== 'array') {
|
||||
throw new TypeError('Request headers has to be of type array');
|
||||
if (headers !== undefined && headers.typeof !== 'undefined' && headers.typeof !== 'object') {
|
||||
throw new TypeError('Request headers has to be of type object');
|
||||
}
|
||||
|
||||
const methodCopied = await method?.copy();
|
||||
|
||||
Reference in New Issue
Block a user