losing host header in wrangler
I have Caddy to proxy to wrangler for a worker. In my local I am struggling to get the sub domain. I know I can pass host wile launching wrangler but that wont scale for integration tests.
And when I add this in Caddy hoping it could be a decent workaround, I am shocked to see the following behavior:
request_header X-Original-Host customer3.mydomain.app
request_header X-Original-Host1 customer3.whatever
request_header X-Custom-Header customer3.mydomain.app
the second header is preserved but the first one it comes in as "mydomain.app". But surprisingly even the third one comes in as mydomain.app. It seems like a real bug to me where some code is doing a simple string parsing on domain matching irrespective of the header.
It's really blocking me to add logic based on subdomain and run the same code in production and local. Also my integration suite in local has to test this flow properly as I use subdomain to run some custom logic.
1 Reply
so Caddy is proxying to worker properly - but any header that has "something.mydomain.app" gets replaced to "mydomain.app"
it seems a bug to me unless there is an easy way to get full host url in local wrangler - can someone please help me? This has become a huge blocker where I might have to go back to plain old nodejs somewhere else instead of worker static assets.
I dont want my integration tests to not run similar to production environment as this is during login flows and can't risk missing a bug.