Created a layer from a WMS Cascading Store
Went back and tried to set HTTP Reponse headers
Got a "Not a Proxy Error"
See attached stack trace.
The cause of this issue was SecureCatalogImpl and SecuredLayerInfo not properly handling the SecuredWMSLayerInfo wrapper.
The SecureCatalogImpl was not unwrapping resources info of type SecuredWMSLayerInfo, this was provoking the "Not a proxy error" exception.
The SecuredWMSLayerInfo was not unwrapping resources info of type SecuredWMSLayerInfo in the setResource method, so it was overriding the existing layer WMSLayerInfo resource with the secure wrapper. So the first request will go well and the next ones will fail (tricky to found this error).