How to debug the content of a variable in a cloudworker script

Hi,

can someone give me a hint to the following challenge:

I have defined a variable in my script and want to pull down a header information into it:

var abc = req.headers.get(‘Host’)
now I want to verify this command and want to know if abc indeed contains any content

any idea how to do this ?

tks

I’m not sure if I really understand your question, but couldn’t you just check if abc is null?

1 Like

problem fixed, stupid me, running the worker script in the cloudflare IDE makes the variable “NULL” once I publish the worker, the variable gets a value…

This topic was automatically closed after 31 days. New replies are no longer allowed.