How to set "header cors" in a worke ? I'm using worker r2 public

interface AppEnv {
PUBLIC: R2Bucket;
}

export default {
async fetch(request: Request, env: AppEnv): Promise {
const {pathname} = new URL(request.url);
const obj = await env.PUBLIC.get(decodeURIComponent(pathname.slice(1, undefined)))
if (obj === null) return new Response(“Not found.”, {status: 404})

    const headers: Record<string, string> = {}
    if (obj?.httpMetadata.contentType) headers['content-type'] = obj?.httpMetadata.contentType;
    if (obj?.httpMetadata.contentEncoding) headers['content-encoding'] = obj?.httpMetadata.contentEncoding;
    if (obj?.httpMetadata.contentDisposition) headers['content-disposition'] = obj?.httpMetadata.contentDisposition;
    if (obj?.httpMetadata.contentLanguage) headers['content-language'] = obj?.httpMetadata.contentLanguage;
    if (obj?.httpMetadata.cacheControl) headers['cache-control'] = obj?.httpMetadata.cacheControl;
    if (obj?.httpMetadata.cacheExpiry) headers['expires'] = obj?.httpMetadata.cacheExpiry.toUTCString();
    return new Response(obj?.body, {
        headers
    });
},

};


I’m using worker r2 public , the example I’m using: [Exemple](https://github.com/cmackenzie1/r2-public-worker)