drunomics / nuxtjs-drupal-ce

A Nuxt module to easily connect Drupal via custom elements.
https://lupus-decoupled.org/
MIT License
22 stars 4 forks source link

feat: pass through response headers on the server #182

Closed fago closed 4 months ago

fago commented 7 months ago

Use cases:

fago commented 7 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.

fago commented 4 months ago

that's implemented now.