Hi,

It's already a server side thing.

As I said, comment everything regarding CORS in Geoserver and add the filter in 
tomcat's web.xml

You should find the string "Built In Filter Definitions" in this file.

Add this under it TO ALLOW ANY ORIGIN (*). Once CORS problem is out of the way, 
you should replace the * under <param-name>cors.allowed.origins</param-name> 
with the specific domains seperated by commas that you want to let go through 
CORS protection :

<!-- Enable CORS -->
<filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
    <param-name>cors.allowed.origins</param-name>
    <param-value>*</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.methods</param-name>
    <param-value>GET,POST,HEAD,OPTIONS</param-value>
  </init-param>
  <init-param>
    <param-name>cors.exposed.headers</param-name>
    
<param-value>Access-Control-Allow-Origin,Access-Control-Allow-Methods</param-value>
    </init-param>
  <init-param>
    <param-name>cors.allowed.headers</param-name>
    
<param-value>authorization,Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Access-Control-Allow-Origin</param-value>
  </init-param>
</filter>
<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>


Envoyé à partir d’Outlook<http://aka.ms/weboutlook>

________________________________
De : emmexx <emm...@tiscalinet.it>
Envoyé : 5 novembre 2021 10:27
À : geoserver-users@lists.sourceforge.net 
<geoserver-users@lists.sourceforge.net>
Objet : Re: [Geoserver-users] WPS and CORS

On 11/5/21 2:38 PM, emmexx wrote:
> I added the cors filter and commented it in the geoserver web.xml but
> geoserver is not starting.

I had copied the filter code from the geoserver documentation that has:
<filter-name>cross-origin</filter-name>

Tomcat Cors documentation has:
<filter-name>CorsFilter</filter-name>

Not sure if that makes any difference and the filter-name is only a
label but geoserver starts if I use the latter in tomcat web.xml. The
wps cors problem is still there.

I'll try a server side solution.

        maxx


_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to