DATAREST-1397 - Polishing.

Removed the redeclaration of hasCorsConfigurationSource(…) in RepositoryRestHandlerMapping as it already inherits the one from BasePathAwareRestHandlerMapping.

Removed @Override on BasePathAwareRestHandlerMapping.hasCorsConfigurationSource(…) as we need to compile against Spring 5.1, which doesn't expose the method. Downgrades from Spring HATEOAS 1.0 API usage in tests.
This commit is contained in:
Oliver Drotbohm
2019-06-21 15:22:27 +02:00
parent 4e586495f4
commit 37b25008b0
3 changed files with 5 additions and 14 deletions

View File

@@ -112,11 +112,12 @@ public class BasePathAwareHandlerMapping extends RequestMappingHandlerMapping {
return super.lookupHandlerMethod(lookupPath, new CustomAcceptHeaderHttpServletRequest(request, mediaTypes));
}
/*
* (non-Javadoc)
/**
* No {@code @Override} as the method is only available in Spring 5.2, but needed to make CORS work in general on it.
*
* @see org.springframework.web.servlet.handler.AbstractHandlerMapping#hasCorsConfigurationSource(java.lang.Object)
* @see https://github.com/spring-projects/spring-framework/issues/22273
*/
@Override
protected boolean hasCorsConfigurationSource(Object handler) {
return true;
}

View File

@@ -190,15 +190,6 @@ public class RepositoryRestHandlerMapping extends BasePathAwareHandlerMapping {
return AnnotationUtils.findAnnotation(type, RepositoryRestController.class) != null;
}
/*
* (non-Javadoc)
* @see org.springframework.web.servlet.handler.AbstractHandlerMapping#hasCorsConfigurationSource(java.lang.Object)
*/
@Override
protected boolean hasCorsConfigurationSource(Object handler) {
return true;
}
/*
* (non-Javadoc)
* @see org.springframework.web.servlet.handler.AbstractHandlerMapping#extendInterceptors(java.util.List)