scramble
scramble copied to clipboard
Support for Adding Custom Headers to Responses
I would like to know if Scramble supports adding custom headers to responses. If not, is this something planned for future updates?
Use Case
In some scenarios, modifying or adding headers (such as Content-Type, Cache-Control, or custom security headers) is necessary when returning a response. This can help with API security, CORS, or performance optimizations.
Expected Behavior
- Ability to configure headers via Response.
- Option to dynamically modify headers based on request conditions.
Example:
paths:
/ping:
get:
summary: Checks if the server is alive.
responses:
"200":
description: OK
headers:
X-RateLimit-Limit:
schema:
type: integer
description: Request limit per hour.
X-RateLimit-Remaining:
schema:
type: integer
description: The number of requests left for the time window.
X-RateLimit-Reset:
schema:
type: string
format: date-time
description: The UTC date/time at which the current rate limit window resets.
content:
........
If this feature is already available, could you provide documentation or an example of how to implement it?