private async Task<HttpResponseMessage> ExecuteActualRequest(HttpControllerContext controllerContext, CancellationToken cancellationToken, MixedModeRequestAuthorizer authorizer) { HttpResponseMessage authMsg; if (authorizer.TryAuthorize(this, out authMsg) == false) return authMsg; var internalHeader = GetHeader("Raven-internal-request"); if (internalHeader == null || internalHeader != "true") RequestManager.IncrementRequestCount(); var fileSystemInternal = await CountersLandlord.GetCounterInternal(CountersName); if (fileSystemInternal == null) { var msg = "Could not find a counters named: " + CountersName; return GetMessageWithObject(new { Error = msg }, HttpStatusCode.ServiceUnavailable); } var sp = Stopwatch.StartNew(); var result = await base.ExecuteAsync(controllerContext, cancellationToken); sp.Stop(); AddRavenHeader(result, sp); return result; }
private async Task<HttpResponseMessage> ExecuteActualRequest(HttpControllerContext controllerContext, CancellationToken cancellationToken, MixedModeRequestAuthorizer authorizer) { if (SkipAuthorizationSinceThisIsMultiGetRequestAlreadyAuthorized == false) { HttpResponseMessage authMsg; if (authorizer.TryAuthorize(this, out authMsg) == false) return authMsg; } if (IsInternalRequest == false) RequestManager.IncrementRequestCount(); if (DatabaseName != null && await DatabasesLandlord.GetDatabaseInternal(DatabaseName) == null) { var msg = "Could not find a database named: " + DatabaseName; return GetMessageWithObject(new { Error = msg }, HttpStatusCode.ServiceUnavailable); } var sp = Stopwatch.StartNew(); var result = await base.ExecuteAsync(controllerContext, cancellationToken); sp.Stop(); AddRavenHeader(result, sp); return result; }