Description:
Problem
Currently, there's no mechanism to define custom response headers, restricting certain operational and security use-cases.
Proposed Solution
Introduce a setHeaders configuration:
schema @server(http: {
setHeaders: {
"X-Custom-Header": "CustomValue",
"Another-Header": "AnotherValue"
}
}) {
query: Query
mutation: Mutation
}
Additional Context
Custom headers can aid in:
- Security enhancements (e.g.,
Content-Security-Policy).
- Operational information (e.g.,
Server-Timing).
- Handling CORS scenarios, by setting headers like
Access-Control-Allow-Origin.
Description:
Problem
Currently, there's no mechanism to define custom response headers, restricting certain operational and security use-cases.
Proposed Solution
Introduce a
setHeadersconfiguration:Additional Context
Custom headers can aid in:
Content-Security-Policy).Server-Timing).Access-Control-Allow-Origin.