public static void DispatchRequest(RequestContext requestContext)
        {
            ExTraceGlobals.CoreCallTracer.TraceDebug(0L, "[RequestDispatcher::DispatchRequest] entry.");
            HttpContext httpContext = requestContext.HttpContext;

            UrlUtilities.RewriteFederatedDomainInURL(httpContext);
            DispatchStepResult arg = RequestDispatcher.InternalDispatchRequest(requestContext);

            ExTraceGlobals.CoreCallTracer.TraceDebug <DispatchStepResult>(0L, "[RequestDispatcher::DispatchRequest] Last dispatch step result={0}.", arg);
            switch (arg)
            {
            case DispatchStepResult.RedirectToUrl:
                ExTraceGlobals.CoreCallTracer.TraceDebug <string>(0L, "[RequestDispatcher::DispatchRequest] Redirecting response to '{0}'.", requestContext.DestinationUrl);
                httpContext.Response.Redirect(requestContext.DestinationUrl, false);
                if (requestContext.RequestType != OwaRequestType.Logoff || !RequestDispatcherUtilities.IsDownLevelClient(requestContext.HttpContext, false))
                {
                    httpContext.ApplicationInstance.CompleteRequest();
                }
                return;

            case DispatchStepResult.RewritePath:
                ExTraceGlobals.CoreCallTracer.TraceDebug <string>(0L, "[RequestDispatcher::DispatchRequest] Rewriting path to '{0}'.", requestContext.DestinationUrl);
                if (string.IsNullOrEmpty(requestContext.DestinationUrlQueryString))
                {
                    httpContext.RewritePath(requestContext.DestinationUrl);
                    return;
                }
                httpContext.RewritePath(requestContext.DestinationUrl, null, requestContext.DestinationUrlQueryString);
                break;

            case DispatchStepResult.RewritePathToError:
            case DispatchStepResult.Continue:
                break;

            case DispatchStepResult.EndResponse:
                ExTraceGlobals.CoreCallTracer.TraceDebug <int>(0L, "[RequestDispatcher::DispatchRequest] Ending response with statusCode={0}.", (int)requestContext.HttpStatusCode);
                HttpUtilities.EndResponse(requestContext.HttpContext, requestContext.HttpStatusCode);
                return;

            case DispatchStepResult.EndResponseWithPrivateCaching:
                ExTraceGlobals.CoreCallTracer.TraceDebug <int>(0L, "[RequestDispatcher::DispatchRequest] Ending response with statusCode={0} and PRIVATE cacheability.", (int)requestContext.HttpStatusCode);
                HttpUtilities.EndResponse(requestContext.HttpContext, requestContext.HttpStatusCode, HttpCacheability.Private);
                return;

            case DispatchStepResult.Stop:
                ExTraceGlobals.CoreCallTracer.TraceDebug(0L, "[RequestDispatcher::DispatchRequest] Stopped the dispatching of this request.");
                return;

            default:
                return;
            }
        }