Browse Source

Polishing

pull/29602/head
Sam Brannen 3 years ago
parent
commit
0a731413de
  1. 2
      spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java
  2. 9
      spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/HtmlFileTransportHandler.java

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

@ -58,7 +58,7 @@ import org.springframework.web.util.WebUtils; @@ -58,7 +58,7 @@ import org.springframework.web.util.WebUtils;
* path resolution and handling of static SockJS requests (e.g. "/info", "/iframe.html",
* etc). Sub-classes must handle session URLs (i.e. transport-specific requests).
*
* By default, only same origin requests are allowed. Use {@link #setAllowedOrigins}
* <p>By default, only same origin requests are allowed. Use {@link #setAllowedOrigins}
* to specify a list of allowed origins (a list containing "*" will allow all origins).
*
* @author Rossen Stoyanchev

9
spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/HtmlFileTransportHandler.java

@ -41,7 +41,7 @@ import org.springframework.web.util.JavaScriptUtils; @@ -41,7 +41,7 @@ import org.springframework.web.util.JavaScriptUtils;
/**
* An HTTP {@link TransportHandler} that uses a famous browser
* {@code document.domain technique}. See <a href=
* {@code document.domain} technique. See <a href=
* "https://stackoverflow.com/questions/1481251/what-does-document-domain-document-domain-do">
* stackoverflow.com/questions/1481251/what-does-document-domain-document-domain-do</a>
* for details.
@ -61,10 +61,13 @@ public class HtmlFileTransportHandler extends AbstractHttpSendingTransportHandle @@ -61,10 +61,13 @@ public class HtmlFileTransportHandler extends AbstractHttpSendingTransportHandle
static {
StringBuilder sb = new StringBuilder("""
<!DOCTYPE html>
<html><head>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head><body><h2>Don't panic!</h2>
</head>
<body>
<h2>Don't panic!</h2>
<script>
document.domain = document.domain;
var c = parent.%s;

Loading…
Cancel
Save