forked from lucidworks/banana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
36 lines (33 loc) · 1.36 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
How to Fix CORS issue for Solr
==============================
1. Copy two jar files into $SOLR_HOME/example/solr-webapp/webapp/WEB-INF/lib/:
- jetty-servlets-8.1.14.v20131031.jar
- jetty-util-8.1.14.v20131031.jar
* NOTE: jetty files v9.x.x do not work.
2. Edit $SOLR_HOME/example/solr-webapp/webapp/WEB-INF/web.xml, by inserting the below <filter> right after <web-app> and before the other <filter> OR
you can just use the web.xml file in this directory:
* NOTE: the order of <filter> does matter
<!-- =================================== -->
<!-- Enable CORS for Banana -->
<!-- =================================== -->
<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>
3. That's it. Restart Solr server and it should work!