Coshmar Godlike
Coshmar Godlike
CDCloudflare Developers
Created by Coshmar Godlike on 2/11/2025 in #workers-help
How to ensure Worker can always access resources from domain protected via Cloudflare Access?
Hi all, I have a worker that is passing part of the traffic to the domain that is protected via Cloudflare Access. It seems that part of the traffic is receiving 302 response code from Cloudflare Access, while when I am in Cloudflare WARP it is always 200. We've followed https://developers.cloudflare.com/cloudflare-one/tutorials/access-workers/ but for some reason it does not work. Is 'company-user-id' a generic header that is supposed to be handled by Cloudflare Access, or is there actually a need to manually handle this scenario? (We've tried dedicated policy, but it seems not to work properly as well) I will appreciate any help / direction in the matter, thank you in advance.
1 replies
CDCloudflare Developers
Created by Coshmar Godlike on 12/23/2024 in #workers-help
Static Asset - Override Headers
Hi all, I have a scenario in which I want to host part of the website from Cloudflare Static Assets, part from origin server. Additionally for a scenario in which I serve static html pages from Cloudflare Static Assets, I want to dynamically set http headers based on some query parameters. I see 2 issues here: 1) If Static Assets is serving file, I can's see my worker logs via Cloudflare Dashboard, 2) It seems that I am unable to modify headers of the response from await env.ASSETS.fetch(path) Am I missing something? Or is this a limitation?
6 replies
CDCloudflare Developers
Created by Coshmar Godlike on 12/23/2024 in #workers-help
Static Assets on zone with domain wildcard
Hi all, When I try to deploy my worker, I have an error:
Workers which have static assets cannot be routed on a URL which has a path component. Update the route to replace //<domain>/* with /*
My use case is - I want to have a worker, bound to a single domain, where in some scenarios I want to serve static site. Does it mean that Static Assets is a no-go in this scenario?
4 replies
CDCloudflare Developers
Created by Coshmar Godlike on 12/3/2024 in #general-help
Key-Value bindings not visible in Cloudflare Dashboard
Hi guys, I have a problem, in which I have a wrangler.toml config:
kv_namespaces = [ { binding = "kv", id = "XYZ", preview_id = "XYZ" }, ] durable_objects.bindings = [ { name = "CONFIGURATION", class_name = "SomeStore" }, ]
And then in the code I am reading / writing values from key value binding. Write operation:
await env.kv.put("SOME_PROP", {"SOME_PROP": "SOME_VAUE"});
Later I am able to read this value:
const id = env.CONFIGURATION.idFromName('SOME_PROP'); return env.CONFIGURATION.get(id); await this.env.kv.get(key)
But here is the question -> why is this value ({"SOME_PROP": "SOME_VAUE"}) not visible in the Cloudflare Dashboard -> Workers & Pages -> KV -> (my namespace by id) -> KV Pairs?
3 replies