1

I have a springboot app in which I got a WS that i'm able to request with a REST client. I also have an angular app and I try to request the WS in it but I got this message :

Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

I've added this code :

 public WebMvcConfigurer corsConfigurer() {
        return new WebMvcConfigurerAdapter() {
            @Override
            public void addCorsMappings(CorsRegistry registry) {
                registry.addMapping("/**");
            }
        };
    }

in my configuration class, like said in this tuto : https://spring.io/guides/gs/rest-service-cors/ but it seems that it's not enough. What do I miss? Do I have to do something in the angular app? Thx

Lempkin
  • 1,458
  • 2
  • 26
  • 49
  • 1
    Refer this post https://stackoverflow.com/questions/46788969/angular2-spring-boot-allow-cross-origin-on-put/46789290#46789290 – hrdkisback Jan 21 '18 at 17:16
  • checkout this https://stackoverflow.com/questions/43166984/delete-method-cors-issue-in-rest-controller – zakaria amine Jan 21 '18 at 18:54
  • See the answer at https://stackoverflow.com/questions/46258449/angular-4-cors-error-requests-are-only-supported-for-protocol-schemes-http/46258496#46258496 Any time you see that *“only supported for protocol schemes”* message, it almost certainly means you’ve just forgotten to include the necessary `https://` or `http://` protocol part in the request URL in your code. – sideshowbarker Jan 21 '18 at 23:35

0 Answers0