Description
It seems that the method setHeader of XWikiServletResponse, meant to relay to the method setHeader of the underlying response actually relays to addHeader which makes it impossible to redefine a header, for example to set a default client and proxy cache policy or for any other purpose.
This was found on the xwiki-core-1.5-curriki branch, hence marking 1.5.2 as affected version but it also is in the current trunk, hence marking the current milestone as affected as well.
The fix is simple:
public void setHeader(String name, String value) { this.response.addHeader(name, value); }
should become:
public void setHeader(String name, String value) { this.response.setHeader(name, value); }
This might break some other things that had not noticed that bug but I doubt it since the method addHeader is there and available anyways.