Updates to version 5.0.0-SNAPSHOT
Changes for Framework 7
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-adapter-parent</artifactId>
|
||||
<version>4.3.1-SNAPSHOT</version>
|
||||
<version>5.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@@ -279,7 +279,7 @@ public class ServerlessHttpServletRequest implements HttpServletRequest {
|
||||
@Override
|
||||
@Nullable
|
||||
public String getContentType() {
|
||||
return this.headers.containsKey(HttpHeaders.CONTENT_TYPE) ? this.headers.get(HttpHeaders.CONTENT_TYPE).get(0) : null;
|
||||
return this.headers.containsHeader(HttpHeaders.CONTENT_TYPE) ? this.headers.get(HttpHeaders.CONTENT_TYPE).get(0) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -713,17 +713,17 @@ public class ServerlessHttpServletRequest implements HttpServletRequest {
|
||||
@Override
|
||||
@Nullable
|
||||
public String getHeader(String name) {
|
||||
return this.headers.containsKey(name) ? this.headers.get(name).get(0) : null;
|
||||
return this.headers.containsHeader(name) ? this.headers.get(name).get(0) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<String> getHeaders(String name) {
|
||||
return Collections.enumeration(this.headers.containsKey(name) ? this.headers.get(name) : new LinkedList<>());
|
||||
return Collections.enumeration(this.headers.containsHeader(name) ? this.headers.get(name) : new LinkedList<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<String> getHeaderNames() {
|
||||
return Collections.enumeration(this.headers.keySet());
|
||||
return Collections.enumeration(this.headers.headerNames());
|
||||
}
|
||||
|
||||
public void setHeader(String name, @Nullable String value) {
|
||||
@@ -735,7 +735,7 @@ public class ServerlessHttpServletRequest implements HttpServletRequest {
|
||||
}
|
||||
|
||||
public void addHeaders(MultiValueMap<String, String> headers) {
|
||||
this.headers.addAll(headers);
|
||||
this.headers.addAll(new HttpHeaders(headers));
|
||||
}
|
||||
|
||||
public void setHeaders(MultiValueMap<String, String> headers) {
|
||||
|
||||
@@ -217,7 +217,7 @@ public class ServerlessHttpServletResponse implements HttpServletResponse {
|
||||
|
||||
@Override
|
||||
public boolean containsHeader(String name) {
|
||||
return this.headers.containsKey(name);
|
||||
return this.headers.containsHeader(name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,7 +231,7 @@ public class ServerlessHttpServletResponse implements HttpServletResponse {
|
||||
*/
|
||||
@Override
|
||||
public Collection<String> getHeaderNames() {
|
||||
return this.headers.keySet();
|
||||
return this.headers.headerNames();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -249,7 +249,7 @@ public class ServerlessHttpServletResponse implements HttpServletResponse {
|
||||
@Override
|
||||
@Nullable
|
||||
public String getHeader(String name) {
|
||||
return this.headers.containsKey(name) ? this.headers.get(name).get(0) : null;
|
||||
return this.headers.containsHeader(name) ? this.headers.get(name).get(0) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -265,7 +265,7 @@ public class ServerlessHttpServletResponse implements HttpServletResponse {
|
||||
*/
|
||||
@Override
|
||||
public List<String> getHeaders(String name) {
|
||||
if (!this.headers.containsKey(name)) {
|
||||
if (!this.headers.containsHeader(name)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return this.headers.get(name);
|
||||
@@ -281,7 +281,7 @@ public class ServerlessHttpServletResponse implements HttpServletResponse {
|
||||
*/
|
||||
@Nullable
|
||||
public Object getHeaderValue(String name) {
|
||||
return this.headers.containsKey(name) ? this.headers.get(name).get(0) : null;
|
||||
return this.headers.containsHeader(name) ? this.headers.get(name).get(0) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -329,6 +329,15 @@ public class ServerlessHttpServletResponse implements HttpServletResponse {
|
||||
setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendRedirect(String location, int statusCode, boolean clearBuffer) throws IOException {
|
||||
Assert.state(!isCommitted(), "Cannot send redirect - response is already committed");
|
||||
Assert.notNull(location, "Redirect URL must not be null");
|
||||
setHeader(HttpHeaders.LOCATION, location);
|
||||
setStatus(statusCode);
|
||||
//TODO: deal with clearBuffer
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getRedirectedUrl() {
|
||||
return getHeader(HttpHeaders.LOCATION);
|
||||
|
||||
Reference in New Issue
Block a user