Skip to content

Support custom response headers #377

@tusharmath

Description

@tusharmath

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions