Header in the response must not be the wildcard '*' when the request's credentials mode is 'include'

前端 未结 4 2167
一生所求
一生所求 2020-12-09 15:12

I\'m using Auth0 for my user authentication to only allow logged in users to access a Spring (Boot) RestController. At this point I\'m creating a r

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 15:24

    Just add .setAllowedOrigins("*") at webSocket config.

    @Override
    public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
        stompEndpointRegistry.addEndpoint("/yourEndpoint");
        stompEndpointRegistry.addEndpoint("/yourEndpoint").setAllowedOrigins("*").withSockJS();
    }
    

    The version of webSocket is 1.4.1.RELEASE,you should update your version if the method wasn't shown.

提交回复
热议问题