in src/main/java/org/apache/sling/engine/impl/request/RequestData.java [166:202]
public RequestData(SlingRequestProcessorImpl slingRequestProcessor,
HttpServletRequest request, HttpServletResponse response,
boolean protectHeadersOnInclude,
boolean checkContentTypeOnInclude,
boolean disableCheckCompliantGetUserPrincipal) {
this.startTimestamp = System.currentTimeMillis();
this.slingRequestProcessor = slingRequestProcessor;
this.servletRequest = request;
this.servletResponse = response;
this.protectHeadersOnInclude = protectHeadersOnInclude;
this.checkContentTypeOnInclude = checkContentTypeOnInclude;
this.disableCheckCompliantGetUserPrincipal = disableCheckCompliantGetUserPrincipal;
this.slingRequest = new SlingHttpServletRequestImpl(this, this.servletRequest);
this.slingResponse = new SlingHttpServletResponseImpl(this, this.servletResponse);
// Use tracker from SlingHttpServletRequest
if ( request instanceof SlingHttpServletRequest ) {
this.requestProgressTracker = ((SlingHttpServletRequest)request).getRequestProgressTracker();
} else {
// Getting the RequestProgressTracker from the request attributes like
// this should not be generally used, it's just a way to pass it from
// its creation point to here, so it's made available via
// the Sling request's getRequestProgressTracker method.
final Object o = request.getAttribute(RequestProgressTracker.class.getName());
if (o instanceof RequestProgressTracker) {
this.requestProgressTracker = (RequestProgressTracker)o;
} else {
log.warn("RequestProgressTracker not found in request attributes");
this.requestProgressTracker = Builders.newRequestProgressTracker();
this.requestProgressTracker.log("Method={0}, PathInfo={1}", request.getMethod(), request.getPathInfo());
}
}
}