use of org.apache.helix.rest.server.filters.CORSFilter in project helix by apache.
the class HelixRestServer method getResourceConfig.
private ResourceConfig getResourceConfig(HelixRestNamespace namespace, ServletType type) {
ResourceConfig cfg = new ResourceConfig();
cfg.packages(type.getServletPackageArray());
cfg.property(ContextPropertyKeys.SERVER_CONTEXT.name(), new ServerContext(namespace.getMetadataStoreAddress()));
if (type == ServletType.DEFAULT_SERVLET) {
cfg.property(ContextPropertyKeys.ALL_NAMESPACES.name(), _helixNamespaces);
} else {
cfg.property(ContextPropertyKeys.METADATA.name(), namespace);
}
cfg.register(new CORSFilter());
cfg.register(new AuditLogFilter(_auditLoggers));
return cfg;
}
Aggregations