-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specifying/retaining headers when injecting HTTP faults. #185
Comments
A possible API coming to my mind could be: const fault = {
errorCode: 500,
errorRate: 0.1,
errorBody: '{"this": "that"}',
errorHeaders: {"This-Is": "A hardcoded header"},
passthroughHeaders: ["Trace-Id"]
}; Perhaps we could allow wildcards in |
A big rock for retaining/passing through headers are non-GET requests. To be able to pass headers through, the proxy would need to perform the real request to upstream, but it will then tell the client that the request did not succeed. For I see two ways out of this:
|
@roobre all those are very valid points. I think we should probably avoid over-engineering or prematurely optimizing the first iteration of the solution and only implement the explicit error headers and take time to better understand the requirements for passthrough headers based on experiences with actual systems using the distuptor. |
Agreed, I think the static headers should cover potential use cases for |
When injecting HTTP faults, the response from the proxy does not carry any header (besides the mandatory Content-lenght).
In some situations, it is convenient to add headers such as the Content-Type (for example, when returning an error body).
Additionally, it worth investigating if in some cases the client expects some headers sent to the server to be also included in the response (for example, transactions ids) and if so, consider a mechanism for supporting this (for example, using
"header-name: *"
to indicate theheader-name
header must be returned in the response if present in the request.The text was updated successfully, but these errors were encountered: