java - Cors filter for localhost and staging url -
we developing java-spring mvc project. in order client team able connect our services created corsfilter: @override protected void dofilterinternal(httpservletrequest request, httpservletresponse response, filterchain filterchain) throws servletexception, ioexception { // populating header required cors string responseurl = this.corsmap.get(request.getservername().tostring()); response.addheader( "access-control-allow-origin", (responseurl == null ? "https://default.ourcompany.com" : responseurl)); response.addheader( "access-control-allow-credentials", "true"); if (request.getheader("access-control-request-method") != null && "options".equals(request.getmethod())) { // cors "pre-flight" request response.addheader( "access-control-allow-methods", "get, post, put, delete"); response.addhead...