Cf object broken in Worker Preview


#1

The Worker cf object is undefined in the Worker Editor Preview. It should be set to something. I wasted 15 minutes debugging why my script passed my tests, but wouldn’t load in the preview. Found the statement and code sample:

// Find TLS version - This will appear as "undefined" in the Preview
// For specific cipher blocking, you can inspect request.cf.tlsCipher
let tlsVersion = (request.cf || {}).tlsVersion

on the page: https://developers.cloudflare.com/workers/recipes/tls-version-blocking/ Which explained the problem. Please update the primary Request Attributes documentation with this information: https://developers.cloudflare.com/workers/reference/request-attributes/

Thanks!