Coder Social home page Coder Social logo

Issue Enabling CORS about docker-geoserver HOT 4 CLOSED

kartoza avatar kartoza commented on June 29, 2024
Issue Enabling CORS

from docker-geoserver.

Comments (4)

eg-novelt avatar eg-novelt commented on June 29, 2024 5

Hello, for me what worked was a few extra init-params, in /usr/local/tomcat/conf/web.xml as follows:

<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.headers</param-name>
        <param-value>If-Mofidied-Since,Range,Origin</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>CorsFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

from docker-geoserver.

ericsvendsen avatar ericsvendsen commented on June 29, 2024

Took me a while to figure out what exactly needed to be added based on your edited comment. Here it is in case anyone else looking at this is as clueless as me 😀

<filter>
    <filter-name>CorsFilter</filter-name>
    <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>CorsFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

from docker-geoserver.

BootstrapB avatar BootstrapB commented on June 29, 2024

Oops sorry about it being unclear, the formatting must have messed up when I pasted my code. Thanks for making it more clear!

from docker-geoserver.

JWDobken avatar JWDobken commented on June 29, 2024

This solved my problem!

However, I still get these console errors:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8600/geoserver/test/wms?bbox=-672645.8489095494,4263351.689633992,-670199.8640044257,4265797.674539115&format=image/png&CRS=EPSG:3857&service=WMS&version=1.3&request=GetMap&srs=EPSG:3857&transparent=true&width=256&height=256&layers=test:T1. (Reason: CORS request did not succeed).[Learn More]

Can this be a feature implementation?

from docker-geoserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.