Exemplo n.º 1
0
        private bool ParseBuildRequest()
        {
            if (_server.RequestCache.TryLookupParsedRequest(_requestContext))
            {
                return(true);
            }

            // parse/build request
            var reqBuilder = new RequestParser(_requestContext);

            if (!reqBuilder.ParseRequest())
            {
                return(false);
            }

            // Map and validate
            var mapper = new RequestMapper(_requestContext);

            mapper.MapAndValidateRequest();
            if (_requestContext.Failed)
            {
                return(false);
            }

            PrepareDirectives();

            var success = !_requestContext.Failed;

            if (success && !_requestContext.Metrics.FromCache)
            {
                _server.RequestCache.AddParsedRequest(_requestContext);
            }
            return(success);
        }