how can a worker script retrieve its current origi...
# workers-help
b
Howdy! What is the best way for a worker script to know its current origin? The use-case is a router library that can match request objects. In a service worker environment, that worker may intercept multiple origins, so SW routers are "origin aware." I want to re-use that library in a CF Worker context. The
WorkerGlobalScope
has a
location
property that seems unavailable (at least on local workers.). Thanks for your help!
k
The request object has a URL property
That's about it
b
That may have to work 😅 It unfortunately means generating the routes when requests are made, but that's a small lift
Thank you for your help 🙂
I think this is something readily solved by devops too, but I'm still at tinkering stage of this project