I think I’m seeing an issue with workers when handling HEAD requests. According to RFC the Content-Length header should be the the same as when doing a GET request. My backend server sends the correct Content-Length but when the request goes through a worker then Content-Length is always 0.
This seems to happen with even a minimal handler like this:
I’m not sure what you mean. HEAD requests are expected to return the same Content-Length that a GET request would. If you’d like to remove the Content-Length in your Worker, you can do that through the normal header modification APIs.
@bryand Hmm, not in my tests. Try opening Cloudflareworkers.com, go to the “Testing” tab, and do a HEAD request there (using the default script and tutorial.Cloudflare.com web site) – I see content-length: 8167.
Are you sure your origin isn’t actually returning Content-Length: 0 ?