Response to preflight request doesn't pass access control check

后端 未结 21 2451
别那么骄傲
别那么骄傲 2020-11-22 03:50

I\'m getting this error using ngResource to call a REST API on Amazon Web Services:

XMLHttpRequest cannot load http://server.apiurl.com:8000/s/login

21条回答
  •  一个人的身影
    2020-11-22 04:24

    The standalone distributions of GeoServer include the Jetty application server. Enable Cross-Origin Resource Sharing (CORS) to allow JavaScript applications outside of your own domain to use GeoServer.

    Uncomment the following and from webapps/geoserver/WEB-INF/web.xml:

    
      
          cross-origin
          org.eclipse.jetty.servlets.CrossOriginFilter
      
      
          cross-origin
          /*
      
    
    

提交回复
热议问题