Skip to content

Commit 5876313

Browse files
committed
fix(be)
1 parent bf84857 commit 5876313

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

backend/src/main/java/com/deliveranything/global/config/WebSocketConfig.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,14 @@
2727
import org.springframework.messaging.support.ChannelInterceptor;
2828
import org.springframework.messaging.support.MessageHeaderAccessor;
2929
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
30-
import org.springframework.security.config.annotation.web.socket.EnableWebSocketSecurity;
3130
import org.springframework.security.core.Authentication;
3231
import org.springframework.security.core.GrantedAuthority;
3332
import org.springframework.security.core.userdetails.UserDetails;
34-
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
3533
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
3634
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
3735

3836
@Slf4j
3937
@Configuration
40-
@EnableWebSocketMessageBroker
41-
@EnableWebSocketSecurity
4238
@RequiredArgsConstructor
4339
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
4440

@@ -52,7 +48,13 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
5248
public void registerStompEndpoints(StompEndpointRegistry registry) {
5349
registry.setErrorHandler(stompErrorHandler);
5450
registry.addEndpoint("/ws")
55-
.setAllowedOriginPatterns("*")
51+
.setAllowedOriginPatterns(
52+
"http://localhost:*",
53+
"https://localhost:*",
54+
"https://cdpn.io",
55+
"https://www.deliver-anything.shop",
56+
"https://api.deliver-anything.shop"
57+
)
5658
.withSockJS();
5759
}
5860

0 commit comments

Comments
 (0)