Commit b0beaebe authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[JM-1196] crossdomain.xml is now served via port 9090 as well.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9533 b35dd754-fafc-0310-a699-88a17e54d16e
parent 72d8714e
......@@ -10,6 +10,8 @@
*/
package org.jivesoftware.openfire.http;
import org.jivesoftware.openfire.XMPPServer;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -24,15 +26,22 @@ import java.io.IOException;
*/
public class FlashCrossDomainServlet extends HttpServlet {
public static String CROSS_DOMAIN_TEXT = "<?xml version=\"1.0\"?>" +
"<!DOCTYPE cross-domain-policy SYSTEM \"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">" +
"<cross-domain-policy>" +
"<allow-access-from domain=\"*\" to-ports=\"";
public static String CROSS_DOMAIN_END_TEXT = "\" /></cross-domain-policy>";
@Override
protected void doGet(HttpServletRequest httpServletRequest,
HttpServletResponse response) throws
ServletException, IOException {
StringBuilder builder = new StringBuilder();
builder.append("<?xml version=\"1.0\"?>\n" +
"<!DOCTYPE cross-domain-policy " +
"SYSTEM \"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">" +
"<cross-domain-policy><allow-access-from domain=\"*\" /></cross-domain-policy>");
builder.append(CROSS_DOMAIN_TEXT +
XMPPServer.getInstance().getConnectionManager().getClientListenerPort() +
CROSS_DOMAIN_END_TEXT);
builder.append("\n");
response.setContentType("text/xml");
response.getOutputStream().write(builder.toString().getBytes());
}
......
......@@ -116,6 +116,11 @@
<servlet-class>org.jivesoftware.openfire.container.PluginIconServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>FlashCrossDomainServlet</servlet-name>
<servlet-class>org.jivesoftware.openfire.http.FlashCrossDomainServlet</servlet-class>
</servlet>
<!--@@JSPC-SERVLETS@@-->
......@@ -134,6 +139,11 @@
<url-pattern>/geticon</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FlashCrossDomainServlet</servlet-name>
<url-pattern>/crossdomain.xml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment