Deprecate JSONP and disable it by default in Jackson view

Issue: SPR-16798
This commit is contained in:
Sebastien Deleuze
2018-06-08 12:29:48 +02:00
parent 75a6f3b2b6
commit 874859493b
11 changed files with 61 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,6 +27,8 @@ import org.springframework.http.HttpMethod;
/**
* SockJS transport types.
*
* <p>JSONP support will be removed as of Spring Framework 5.1, use others transports instead.
*
* @author Rossen Stoyanchev
* @author Sebastien Deleuze
* @since 4.0
@@ -39,8 +41,10 @@ public enum TransportType {
XHR_SEND("xhr_send", HttpMethod.POST, "cors", "jsessionid", "no_cache"),
@Deprecated
JSONP("jsonp", HttpMethod.GET, "jsessionid", "no_cache"),
@Deprecated
JSONP_SEND("jsonp_send", HttpMethod.POST, "jsessionid", "no_cache"),
XHR_STREAMING("xhr_streaming", HttpMethod.POST, "cors", "jsessionid", "no_cache"),

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -78,6 +78,7 @@ public class DefaultSockJsService extends TransportHandlingSockJsService impleme
}
@SuppressWarnings("deprecation")
private static Set<TransportHandler> getDefaultTransportHandlers(Collection<TransportHandler> overrides) {
Set<TransportHandler> result = new LinkedHashSet<TransportHandler>(8);
result.add(new XhrPollingTransportHandler());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,7 +40,9 @@ import org.springframework.web.util.JavaScriptUtils;
*
* @author Rossen Stoyanchev
* @since 4.0
* @deprecated Will be removed as of Spring Framework 5.1, use others transports instead.
*/
@Deprecated
public class JsonpPollingTransportHandler extends AbstractHttpSendingTransportHandler {
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,9 @@ import org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJ
* A {@link TransportHandler} that receives messages over HTTP.
*
* @author Rossen Stoyanchev
* @deprecated Will be removed as of Spring Framework 5.1, use others transports instead.
*/
@Deprecated
public class JsonpReceivingTransportHandler extends AbstractHttpReceivingTransportHandler {
private final FormHttpMessageConverter formConverter = new FormHttpMessageConverter();