Shopify app CORS issue in checkout UI and fly.io

Hi,
I’m trying to call my remix app from checkout ui extension. I use Authorization header as suggested in the docs

const response = await fetch(`${DEV_URL}/api/cross-sells`, {
        method: 'POST',
        body: JSON.stringify(
          {
            lines: lines,
            shop: shop.myshopifyDomain
          }
        ),
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Bearer ....`,
        },
      });

Then in the backend I do

export const action = async ({ request }: ActionFunctionArgs) => {
 const {sessionToken, cors} = await authenticate.public.checkout(request);

... some processing ...

    return cors(json({ products: filteredProducts, shop: sessionToken.dest }));
}

I’m stuck and don’t know what to do. Locally everything seems to work, but after I deploy to fly.io and test on the server the CORS issue shows.