How to check if worker is running in wrangler dev

Im developing a worker as a middleman api using wrangler 2.x. To protect the middleman from unwanted requests, it checks requests against a whitelist of allowed domains.

However when using wrangler I have to manually disable this whitelist check with a flag, as adding urls to my whitelist that wrangler listens on (Listening at or the worker’s own url https://<YOUR-WORKER>.<YOUR-ACCOUNT> doesn’t work the response object returned by fetch event.headers.get('origin') is null.

Is there another means to check if requests are coming via wrangler, or programmatically check if the script if being run in a wrangler context?

Just to follow on, I’ve confirmed that pinging the worker itself on it’s own .dev domain also returns a null origin. So assuming this is secure, it may simply be enough to check that the origin is null in my use case.