Create utility method for accessing the reqyest detail
@@ -848,7 +848,7 @@ public class RestfulServer extends HttpServlet implements IRestfulServer<Servlet
@SuppressWarnings("WeakerAccess")
protected void handleRequest(RequestTypeEnum theRequestType, HttpServletRequest theRequest, HttpServletResponse theResponse) throws ServletException, IOException {
String fhirServerBase;
- ServletRequestDetails requestDetails = new ServletRequestDetails(getInterceptorService());
+ ServletRequestDetails requestDetails = newRequestDetails();
requestDetails.setServer(this);
requestDetails.setRequestType(theRequestType);
requestDetails.setServletRequest(theRequest);
@@ -1095,6 +1095,10 @@ public class RestfulServer extends HttpServlet implements IRestfulServer<Servlet
}
}
+ protected ServletRequestDetails newRequestDetails() {
+ return new ServletRequestDetails(getInterceptorService());
+ }
+
protected void addRequestIdToResponse(ServletRequestDetails theRequestDetails, String theRequestId) {
theRequestDetails.getResponse().addHeader(Constants.HEADER_REQUEST_ID, theRequestId);
}
