Skip to content

Commit a6e1c53

Browse files
committed
Update default SockJS CDN location
This commit updates the default location of the SockJS' client library. The previous location is being retired by the project maintainers. The new default location is backed by several CDN providers: * https://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js See sockjs/sockjs-client#198 Issue: SPR-12254
1 parent 3827e04 commit a6e1c53

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/SockJsServiceRegistration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public SockJsServiceRegistration setTaskScheduler(TaskScheduler taskScheduler) {
8383
* this property allows specifying where to load it from.
8484
*
8585
* <p>By default this is set to point to
86-
* "https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.4.min.js". However it can
86+
* "https://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js". However it can
8787
* also be set to point to a URL served by the application.
8888
*
8989
* <p>Note that it's possible to specify a relative URL in which case the URL

spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public abstract class AbstractSockJsService implements SockJsService {
6868

6969
private String name = "SockJSService@" + ObjectUtils.getIdentityHexString(this);
7070

71-
private String clientLibraryUrl = "https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.4.min.js";
71+
private String clientLibraryUrl = "https://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js";
7272

7373
private int streamBytesLimit = 128 * 1024;
7474

spring-websocket/src/test/java/org/springframework/web/socket/sockjs/support/SockJsServiceTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,15 @@ public void handleIframeRequest() throws Exception {
148148

149149
assertEquals("text/html;charset=UTF-8", this.servletResponse.getContentType());
150150
assertTrue(this.servletResponse.getContentAsString().startsWith("<!DOCTYPE html>\n"));
151-
assertEquals(496, this.servletResponse.getContentLength());
151+
assertEquals(490, this.servletResponse.getContentLength());
152152
assertEquals("public, max-age=31536000", this.response.getHeaders().getCacheControl());
153-
assertEquals("\"0da1ed070012f304e47b83c81c48ad620\"", this.response.getHeaders().getETag());
153+
assertEquals("\"06b486b3208b085d9e3220f456a6caca4\"", this.response.getHeaders().getETag());
154154
}
155155

156156
@Test
157157
public void handleIframeRequestNotModified() throws Exception {
158158

159-
this.servletRequest.addHeader("If-None-Match", "\"0da1ed070012f304e47b83c81c48ad620\"");
159+
this.servletRequest.addHeader("If-None-Match", "\"06b486b3208b085d9e3220f456a6caca4\"");
160160

161161
resetResponseAndHandleRequest("GET", "/echo/iframe.html", HttpStatus.NOT_MODIFIED);
162162
}

0 commit comments

Comments
 (0)