terça-feira, 22 de maio de 2018

Cross Origin no Solr


Edit the server/solr-webapp/webapp/WEB-INF/web.xmlfile to include the following filter right after the  line. On a clean Solr 5.0.0 download this entry will start at line 24.
 
  <filter>
   <filter-name>cross-origin</filter-name>
   <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
   <init-param>
     <param-name>allowedOrigins</param-name>
     <param-value>*</param-value>
   </init-param>
   <init-param>
     <param-name>allowedMethods</param-name>
     <param-value>GET,POST,OPTIONS,DELETE,PUT,HEAD</param-value>
   </init-param>
   <init-param>
     <param-name>allowedHeaders</param-name>
     <param-value>origin, content-type, accept</param-value>
   </init-param>
 </filter>

 <filter-mapping>
   <filter-name>cross-origin</filter-name>
   <url-pattern>/*</url-pattern>
 </filter-mapping>

Fonte: https://opensourceconnections.com/blog/2015/03/26/going-cross-origin-with-solr/

Nenhum comentário:

Postar um comentário