Unit test for empty Access-Control-Request-Headers (Chrome 52)
Includes optimized method/header resolution in CorsConfiguration. Issue: SPR-14617
This commit is contained in:
@@ -64,8 +64,7 @@ import org.springframework.web.util.UrlPathHelper;
|
||||
* @see #setInterceptors
|
||||
* @see org.springframework.web.servlet.HandlerInterceptor
|
||||
*/
|
||||
public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
|
||||
implements HandlerMapping, Ordered {
|
||||
public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport implements HandlerMapping, Ordered {
|
||||
|
||||
private int order = Integer.MAX_VALUE; // default: same as non-Ordered
|
||||
|
||||
@@ -236,6 +235,7 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
|
||||
return this.corsConfigSource.getCorsConfigurations();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the interceptors.
|
||||
* @see #extendInterceptors(java.util.List)
|
||||
@@ -339,6 +339,7 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
|
||||
return (count > 0 ? mappedInterceptors.toArray(new MappedInterceptor[count]) : null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Look up a handler for the given request, falling back to the default
|
||||
* handler if no specific one is found.
|
||||
@@ -480,9 +481,7 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleRequest(HttpServletRequest request, HttpServletResponse response)
|
||||
throws IOException {
|
||||
|
||||
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
corsProcessor.processRequest(this.config, request, response);
|
||||
}
|
||||
|
||||
@@ -502,8 +501,8 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response,
|
||||
Object handler) throws Exception {
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
return corsProcessor.processRequest(this.config, request, response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user