Class BanUnsupportedHttpMethodsInterceptor
java.lang.Object
ca.uhn.fhir.rest.server.interceptor.InterceptorAdapter
ca.uhn.fhir.rest.server.interceptor.BanUnsupportedHttpMethodsInterceptor
- All Implemented Interfaces:
IServerInterceptor
This interceptor causes the server to reject invocations for HTTP methods
other than those supported by the server with an HTTP 405. This is a requirement
of some security assessments.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
incomingRequestPreProcessed
(jakarta.servlet.http.HttpServletRequest theRequest, jakarta.servlet.http.HttpServletResponse theResponse) This method is called before any other processing takes place for each incoming request.Methods inherited from class ca.uhn.fhir.rest.server.interceptor.InterceptorAdapter
handleException, incomingRequestPostProcessed, incomingRequestPreHandled, outgoingResponse, outgoingResponse, outgoingResponse, outgoingResponse, outgoingResponse, outgoingResponse, outgoingResponse, preProcessOutgoingException, processingCompletedNormally
-
Constructor Details
-
BanUnsupportedHttpMethodsInterceptor
public BanUnsupportedHttpMethodsInterceptor()
-
-
Method Details
-
incomingRequestPreProcessed
public boolean incomingRequestPreProcessed(jakarta.servlet.http.HttpServletRequest theRequest, jakarta.servlet.http.HttpServletResponse theResponse) Description copied from interface:IServerInterceptor
This method is called before any other processing takes place for each incoming request. It may be used to provide alternate handling for some requests, or to screen requests before they are handled, etc.Note that any exceptions thrown by this method will not be trapped by HAPI (they will be passed up to the server)
- Specified by:
incomingRequestPreProcessed
in interfaceIServerInterceptor
- Overrides:
incomingRequestPreProcessed
in classInterceptorAdapter
- Parameters:
theRequest
- The incoming requesttheResponse
- The response. Note that interceptors may choose to provide a response (i.e. by callingServletResponse.getWriter()
) but in that case it is important to returnfalse
to indicate that the server itself should not also provide a response.- Returns:
- Return
true
if processing should continue normally. This is generally the right thing to do. If your interceptor is providing a response rather than letting HAPI handle the response normally, you must returnfalse
. In this case, no further processing will occur and no further interceptors will be called.
-