You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the following terraform to try and create a simple worker with an empty plain text binding:
resource "cloudflare_workers_script" "empty_blinding_edge_worker" {
account_id = "<account-id>"
name = "empty_binding_edge_worker"
content = file("worker.js")
plain_text_binding {
name = "EVEN_MORE_BLANK_TEXT"
text = ""
}
}
worker.js
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
return new Response('Hello Worker!');
}
Running terraform apply will produce an error indicating that the text for the binding cannot be empty. This behavior differs from that of the UI and API though. In order to replicate with the UI/API, see Expected output section above.
References
No response
The text was updated successfully, but these errors were encountered:
Confirmation
cloudflare-go version
v0.100.0
Go environment
Expected output
Running
terraform apply
with the following worker configuration, notably plain text binding, should succeed:Empty PlainTextBindings are supported by the Cloudflare UI as well as the API itself.
UI:
API:
metadata.json looks like the following:
Actual output
Code demonstrating the issue
From https://github.com/cloudflare/cloudflare-go/blob/master/workers_bindings.go#L214-L216:
Steps to reproduce
Use the following terraform to try and create a simple worker with an empty plain text binding:
worker.js
Running
terraform apply
will produce an error indicating that the text for the binding cannot be empty. This behavior differs from that of the UI and API though. In order to replicate with the UI/API, see Expected output section above.References
No response
The text was updated successfully, but these errors were encountered: