Skip to content

Commit 4f61978

Browse files
committed
Revert change from URL Cleanup
1 parent 57ab877 commit 4f61978

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spring-websocket/src/test/java/org/springframework/web/socket/server/support/OriginHandshakeInterceptorTests.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -61,7 +61,7 @@ public void originValueNoMatch() throws Exception {
6161
Map<String, Object> attributes = new HashMap<>();
6262
WebSocketHandler wsHandler = Mockito.mock(WebSocketHandler.class);
6363
this.servletRequest.addHeader(HttpHeaders.ORIGIN, "https://mydomain1.com");
64-
List<String> allowed = Collections.singletonList("/QTifZ/");
64+
List<String> allowed = Collections.singletonList("https://mydomain2.com");
6565
OriginHandshakeInterceptor interceptor = new OriginHandshakeInterceptor(allowed);
6666
assertFalse(interceptor.beforeHandshake(request, response, wsHandler, attributes));
6767
assertEquals(servletResponse.getStatus(), HttpStatus.FORBIDDEN.value());
@@ -71,8 +71,8 @@ public void originValueNoMatch() throws Exception {
7171
public void originListMatch() throws Exception {
7272
Map<String, Object> attributes = new HashMap<>();
7373
WebSocketHandler wsHandler = Mockito.mock(WebSocketHandler.class);
74-
this.servletRequest.addHeader(HttpHeaders.ORIGIN, "/QTifZ/");
75-
List<String> allowed = Arrays.asList("https://mydomain1.com", "/QTifZ/", "http://mydomain3.com");
74+
this.servletRequest.addHeader(HttpHeaders.ORIGIN, "https://mydomain2.com");
75+
List<String> allowed = Arrays.asList("https://mydomain1.com", "https://mydomain2.com", "http://mydomain3.com");
7676
OriginHandshakeInterceptor interceptor = new OriginHandshakeInterceptor(allowed);
7777
assertTrue(interceptor.beforeHandshake(request, response, wsHandler, attributes));
7878
assertNotEquals(servletResponse.getStatus(), HttpStatus.FORBIDDEN.value());
@@ -83,7 +83,7 @@ public void originListNoMatch() throws Exception {
8383
Map<String, Object> attributes = new HashMap<>();
8484
WebSocketHandler wsHandler = Mockito.mock(WebSocketHandler.class);
8585
this.servletRequest.addHeader(HttpHeaders.ORIGIN, "http://www.mydomain4.com/");
86-
List<String> allowed = Arrays.asList("https://mydomain1.com", "/QTifZ/", "http://mydomain3.com");
86+
List<String> allowed = Arrays.asList("https://mydomain1.com", "https://mydomain2.com", "http://mydomain3.com");
8787
OriginHandshakeInterceptor interceptor = new OriginHandshakeInterceptor(allowed);
8888
assertFalse(interceptor.beforeHandshake(request, response, wsHandler, attributes));
8989
assertEquals(servletResponse.getStatus(), HttpStatus.FORBIDDEN.value());

0 commit comments

Comments
 (0)