Hi!
I’d like to specify the cache-control header when serving the crossdomain.xml file.
I tried doing a HTTPProvider that builds and sends this file. However it seems that it always takes the file in the conf directory.
Here’s my VHost.xml configuration for that HTTPProvider:
<HTTPProviders>
<HTTPProvider>
<BaseClass>com.custom.http.HTTPCrossdomain</BaseClass>
<RequestFilters>*crossdomain.xml</RequestFilters>
<AuthenticationMethod>none</AuthenticationMethod>
</HTTPProvider>
(...)
</HTTPProviders>
And the HTTPProvider Code (is in another package so it doesn’t collide with wowza.wms)
public class HTTPCrossdomain extends HTTProvider2Base {
public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp) {
if (!doHTTPAuthentication(vhost, req, resp))
return;
StringBuffer response = new StringBuffer();
response.append("<?xml version=\"1.0\"?>");
response.append("<!DOCTYPE cross-domain-policy SYSTEM \"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd\">");
response.append("<cross-domain-policy>");
response.append("<allow-access-from domain=\"*\"/>");
response.append("<site-control permitted-cross-domain-policies=\"all\"/>");
response.append("</cross-domain-policy>");
try {
resp.setHeader("Content-Type", "text/xml");
resp.setHeader("Cache-Control", "foo");
OutputStream out = resp.getOutputStream();
byte[] outBytes = response.toString().getBytes();
out.write(outBytes);
} catch (Exception e) {
WMSLoggerFactory.getLogger(null).error(
"ERROR: " + e.toString());
}
}
}
I’ve tried removing the file at the conf directory but then the server responds with 404. It doesn’t take in consideration the HTTPProvider one
Any help?