fix(core): Improve nested DNS record management and worker script multipart handling

This commit is contained in:
2025-04-26 12:37:19 +00:00
parent e1c38ab7f8
commit 4b82cfbaae
6 changed files with 72 additions and 9 deletions

View File

@@ -22,11 +22,15 @@ export class WorkerManager {
}
try {
// Use the official client to create/update the worker
// Use the official client to create/update the worker (upload script content)
await this.cfAccount.apiAccount.workers.scripts.content.update(workerName, {
account_id: this.cfAccount.preselectedAccountId,
"CF-WORKER-BODY-PART": workerScript,
metadata: {}
// name the multipart part for the script code
metadata: { body_part: 'script' },
/* header to indicate which part contains the script */
'CF-WORKER-BODY-PART': 'script',
// include the actual script as a form part named 'script'
script: workerScript,
});
// Create a new worker instance