Expected Behavior
After adding ".cacheControl()" there should be an option to override header write decider.
Current Behavior
CacheControlHeadersWriter is final, and decide logic in writeHeaders is can not be overriden. Need to write our own implementation, even copying some portion of code.
Context
Current write logic is not proper to us. Also existence of one of headers, blocking other headers to write.
I can introduce a PR.
Comment From: jgrandja
Thanks for the suggestion @okohub.
However, CacheControlHeadersWriter is a very basic implementation and I don't think there is value in allowing for customization.
If http.headers().cacheControl() does not suit your needs, then I would suggest not configuring it and instead provide your own custom headers as follows:
List<Header> customHeaders = ...
http.headers().addHeaderWriter(
new StaticHeadersWriter(customHeaders));
I'm going to close this as addHeaderWriter() is the primary extension point for custom headers.
Comment From: okohub
@jgrandja thank you for response! :)