nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.13k stars 627 forks source link

Add request headers to queryContent #2460

Closed oripka closed 1 month ago

oripka commented 11 months ago

I want to use queryContent in an app that provides content only to authenticated users. For this to work queryContent needs to send the current cookie header to the server.

Currently I construct the query manually in a hacky way:

  return $fetch('/api/_content/query' + params, {
    headers: useRequestHeaders(['cookie']),
    method: 'GET'
  })

Could we add the possibility to add certain headers before sending the query? Or is there a way to do that already without avoiding queryContent?

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 30 days with no activity.