Bug: http_endpoint, media, HttpResponse - Internal server error serving Lazy Media

What I’m trying to do:
Allow users to see a file:
https://client.planplate.com/_/api/menu/a022c1f9-7cc3-44ce-9523-0952a8b6f8be/4d91c3b5-8e57-4e7c-9c4f-5c49590b6b22

What I’ve tried and what’s not working:
Placed that link on dilettante.lv, when clicked it opens like this:

Code Sample:

@anvil.server.http_endpoint("/menu/:resto_id/:menu_id", enable_cors=True, cross_site_session=True)
def serve_menu(resto_id, menu_id, **p):
  menu_in_db = app_tables.menu_files.get(restaurant=resto_id, menu_id=menu_id)
  if menu_in_db is not None and menu_in_db['menu_file'] is not None:
    media = menu_in_db['menu_file']
    return anvil.server.HttpResponse(status=200, body=media, headers=None)
    # return media #also has the same error
  else:
    return anvil.server.HttpResponse(body="Media not found", status=404)

If it helps on the originator site I get this:
image

What is the “Internal server error serving Lazy Media: 2d9446ec3d44” ?
How do I fix it?

Fixed, but I am not sure which method worked:

@anvil.server.http_endpoint("/menu/:resto_id/:menu_id", enable_cors=True)
def serve_menu(resto_id, menu_id, **p):
  menu_in_db = app_tables.menu_files.get(restaurant=resto_id, menu_id=menu_id)
  if menu_in_db is not None and menu_in_db['menu_file'] is not None:
    media = menu_in_db['menu_file']
    _ = media.get_bytes()
    return anvil.server.HttpResponse(status=200, body=media, headers={"Content-Type": media.content_type})
  else:
    return anvil.server.HttpResponse(body="Media not found", status=404)

Removed cross_site_session=True - not sure if that had an impact.
Added _ = media.get_bytes() so it loads the media before returning.
Changed headers={“Content-Type”: media.content_type} so the site knows what to expect.

Would love any insight, but in case it helps anyone else leaving this here.

Thank you!