-
Notifications
You must be signed in to change notification settings - Fork 683
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
Add response headers documentation incorrect #4155
Comments
I tested this and can confirm the behavior of validation errors when trying to use |
From engineering: the v2 add_response_headers allowed string, bool, and objects. In v3alpha1, only objects are allowed. We'll raise a docs request to fix the reference there, and close this issue. |
I need to configure the HTTP Strict Transport Security(HSTS) response header. So in order to add response headers I am following this document:
After applying this, I am getting following error. Can someone let me know how to resolve this and what is the correct way of adding response_headers?
Any solution how to resolve it ? |
Following solution worked for me
thanks @cindymullins-dw |
Thanks for reporting @so-amuk! |
This is still broken. @so-amuk 's solution works, but that's just an alternative to defining the headers directly as strings. Even the docs mention both options are supported. The example from the docs isn't working. Is this a bug in the schema generation?
|
This has bitten my team as well just today with the latest emissary. I don't think this is actually solved. @cindymullins-dw |
According to documentation
add_response_headers
acceptsstring
,bool
orobject
as shown in the exampleMapping
:When using anything other than an
object
you receive error message:error: error validating "mapping.yaml": error validating data: ValidationError(Mapping.spec.add_response_headers.x-test-proto): invalid type for io.getambassador.v3alpha1.Mapping.spec.add_response_headers: got "string", expected "map"; if you choose to ignore these errors, turn validation off with --validate=false
Looking at the CRD definitions (if my understanding is correct):
It looks like it only accepts an
object
.Steps to reproduce the behavior:
This error is present on the latest version
2.2.2
.The text was updated successfully, but these errors were encountered: