i was looking into that but couldnt find a way to modify the page based on path
i was looking into that but couldnt find a way to modify the page based on path
const res = context.env.ASSETS.fetch and then do a const text = await res.text() and then modify it and return it.




How do I call the fetch on service A without having to manually specify the URL as it might changeWhen using the service binding the URL doesn't really "mean" anything in the normal fetch sense here, it just is passed verbatim to the other Worker in
request.url. It will still hit that worker even if you put something silly like http://dummy.how can I stop external requests from being able to hit project A directly?Disable the workers.dev subdomain for the Worker (
workers_dev = false in wrangler.toml) and don't define any routes entries for it.

(Reason: CORS preflight response did not succeed). Status code: 500.This indicates the issue is not with the headers, but rather the fact that the request is returning 500 instead of 200. Most likely a 500 in this context means the Worker thew an exception, check the log for that error to see why: https://developers.cloudflare.com/workers/observability/logging/
no-transform on the request, it still doesn't work..return new Response(JSON.stringify({ url: uploadUrl }), {
status: 200,
statusText: 'OK',
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,HEAD,POST,OPTIONS",
"Access-Control-Max-Age": "86400",
"Access-Control-Allow-Headers": "Content-Type"
}
});const res = context.env.ASSETS.fetchconst text = await res.text()export const onRequestGet: PagesFunction = async (context) => {
const path = new URL(context.request.url).pathname;
return context.env.ASSETS.fetch(context.request);
};