Java Code Examples for org.springframework.web.bind.annotation.RequestMethod#TRACE

The following examples show how to use org.springframework.web.bind.annotation.RequestMethod#TRACE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ErrorHandlingConfig.java    From guardedbox with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Error handler.
 *
 * @return Unauthorized (401), Forbidden (403) or Not Found (404) with no body.
 */
@RequestMapping(value = "/error", method = {RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT,
        RequestMethod.DELETE, RequestMethod.HEAD, RequestMethod.OPTIONS, RequestMethod.PATCH, RequestMethod.TRACE})
public ResponseEntity<?> error() {

    Map<String, Object> requestErrorAttributes = errorAttributes.getErrorAttributes(
            new ServletWebRequest(request), ErrorAttributeOptions.defaults());
    HttpStatus errorStatus = HttpStatus.valueOf((Integer) requestErrorAttributes.get("status"));

    if (HttpStatus.UNAUTHORIZED.equals(errorStatus) || HttpStatus.FORBIDDEN.equals(errorStatus)) {
        session.invalidate();
        return new ResponseEntity<>(errorStatus);
    } else {
        return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }

}
 
Example 2
Source File: TestLibController.java    From zstack with Apache License 2.0 5 votes vote down vote up
@RequestMapping(
        value = "/**",
        method = {
                RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE, RequestMethod.GET,
                RequestMethod.HEAD, RequestMethod.OPTIONS, RequestMethod.PATCH, RequestMethod.TRACE
        }
)
public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
    Test.handleHttp(request, response);
}
 
Example 3
Source File: ServletAnnotationControllerHandlerMethodTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@RequestMapping(value = "/myPath.do", method = RequestMethod.TRACE)
public void trace() {
}
 
Example 4
Source File: ServletAnnotationControllerHandlerMethodTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@RequestMapping(value = "/myPath.do", method = RequestMethod.TRACE)
public void trace() {
}
 
Example 5
Source File: UnsafeSpringCsrfRequestMappingController.java    From Android_Code_Arbiter with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Mapping to several HTTP request methods is not OK if it's a mix of unprotected and protected HTTP request methods.
 */
@RequestMapping(value = "/request-mapping-all-unprotected-methods-and-one-protected-method",
        method = {RequestMethod.GET, RequestMethod.HEAD, RequestMethod.TRACE, RequestMethod.OPTIONS, RequestMethod.PATCH})
public void requestMappingAllUnprotectedMethodsAndOneProtectedMethod() {
}
 
Example 6
Source File: SafeSpringCsrfRequestMappingController.java    From Android_Code_Arbiter with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Mapping to the HTTP request method `TRACE` is safe as long as no state-changing operations are performed within this method.
 */
@RequestMapping(value = "/request-mapping-trace", method = RequestMethod.TRACE)
public void requestMappingTrace() {
}
 
Example 7
Source File: SafeSpringCsrfRequestMappingController.java    From Android_Code_Arbiter with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Mapping to several HTTP request methods is fine as long as all the HTTP request methods used are unprotected.
 */
@RequestMapping(value = "/request-mapping-several-unprotected-methods",
        method = {RequestMethod.GET, RequestMethod.HEAD, RequestMethod.TRACE, RequestMethod.OPTIONS})
public void requestMappingSeveralUnprotectedMethods() {
}
 
Example 8
Source File: ServletAnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@RequestMapping(value = "/myPath.do", method = RequestMethod.TRACE)
public void trace() {
}
 
Example 9
Source File: ServletAnnotationControllerHandlerMethodTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@RequestMapping(value = "/myPath.do", method = RequestMethod.TRACE)
public void trace() {
}