Remove JSONP support
CORS is now widely supported and should be used instead for cross-domain requests. Issue: SPR-16914
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 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.
|
||||
@@ -95,21 +95,6 @@ public class MappingJackson2HttpMessageConverter extends AbstractJackson2HttpMes
|
||||
if (this.jsonPrefix != null) {
|
||||
generator.writeRaw(this.jsonPrefix);
|
||||
}
|
||||
String jsonpFunction =
|
||||
(object instanceof MappingJacksonValue ? ((MappingJacksonValue) object).getJsonpFunction() : null);
|
||||
if (jsonpFunction != null) {
|
||||
generator.writeRaw("/**/");
|
||||
generator.writeRaw(jsonpFunction + "(");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeSuffix(JsonGenerator generator, Object object) throws IOException {
|
||||
String jsonpFunction =
|
||||
(object instanceof MappingJacksonValue ? ((MappingJacksonValue) object).getJsonpFunction() : null);
|
||||
if (jsonpFunction != null) {
|
||||
generator.writeRaw(");");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 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.
|
||||
@@ -45,9 +45,6 @@ public class MappingJacksonValue {
|
||||
@Nullable
|
||||
private FilterProvider filters;
|
||||
|
||||
@Nullable
|
||||
private String jsonpFunction;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new instance wrapping the given POJO to be serialized.
|
||||
@@ -113,19 +110,4 @@ public class MappingJacksonValue {
|
||||
return this.filters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the name of the JSONP function name.
|
||||
*/
|
||||
public void setJsonpFunction(@Nullable String functionName) {
|
||||
this.jsonpFunction = functionName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the configured JSONP function name.
|
||||
*/
|
||||
@Nullable
|
||||
public String getJsonpFunction() {
|
||||
return this.jsonpFunction;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user