Closed fago closed 4 months ago
https://github.com/drunomics/nuxtjs-drupal-ce/blob/2.x/src/runtime/composables/useDrupalCe.ts#L82
This is were the request is made. Response headers can be set by middleware: https://medium.com/@dev.frederic.fox/setting-response-headers-on-nuxt3-eaec3b54fc0e
I guess we could define a global server-only middleware that takes care of pass through of response headers: https://nuxt.com/docs/guide/directory-structure/middleware#ordering-global-middleware
But we need to make the the headers available somewhere. Could we make the whole response object available via our composable? Then our server middleware could respect a new setting and pass through a couple of configured response headers.
that's implemented now.
fetchProxyHeaders option currently defaults to ['cookie'] - so by default a set authentication cookie is passed through see related
https://github.com/drunomics/nuxtjs-drupal-ce/pull/127
https://github.com/drunomics/lupus-nuxt-kickstart/pull/318/files
https://axios.nuxtjs.org/options#proxyheaders (library which was used in nuxt2)
we should to make sure we also pass through response headers to the client as needed / wanted. We probably want to introduce a new configuration option for that.
Use cases: