Fixed some unit tests

This commit is contained in:
Philip Wood
2017-04-18 14:05:15 +01:00
parent 8b93f44077
commit 7c1a277147
12 changed files with 145 additions and 425 deletions

View File

@ -27,14 +27,14 @@ namespace Ocelot.Cache.Middleware
public async Task Invoke(HttpContext context)
{
var downstreamUrlKey = DownstreamRequest.RequestUri.OriginalString;
if (!DownstreamRoute.ReRoute.IsCached)
{
await _next.Invoke(context);
return;
}
var downstreamUrlKey = DownstreamRequest.RequestUri.OriginalString;
_logger.LogDebug("started checking cache for {downstreamUrlKey}", downstreamUrlKey);
var cached = _outputCache.Get(downstreamUrlKey);

View File

@ -51,7 +51,6 @@ namespace Ocelot.QueryStrings
public Response SetQueriesOnDownstreamRequest(List<ClaimToThing> claimsToThings, IEnumerable<Claim> claims, HttpRequestMessage downstreamRequest)
{
var queryDictionary = ConvertQueryStringToDictionary(downstreamRequest.RequestUri.Query);
foreach (var config in claimsToThings)

View File

@ -1,8 +1,5 @@
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;
using Ocelot.Responses;
using Ocelot.Configuration;
using Ocelot.Requester.QoS;
using System.Net.Http;
@ -10,32 +7,6 @@ namespace Ocelot.Request.Builder
{
public sealed class HttpRequestCreator : IRequestCreator
{
//public async Task<Response<Request>> Build(
// string httpMethod,
// string downstreamUrl,
// Stream content,
// IHeaderDictionary headers,
// QueryString queryString,
// string contentType,
// RequestId.RequestId requestId,
// bool isQos,
// IQoSProvider qosProvider)
//{
// var request = await new RequestBuilder()
// .WithHttpMethod(httpMethod)
// .WithDownstreamUrl(downstreamUrl)
// .WithQueryString(queryString)
// .WithContent(content)
// .WithContentType(contentType)
// .WithHeaders(headers)
// .WithRequestId(requestId)
// .WithIsQos(isQos)
// .WithQos(qosProvider)
// .Build();
// return new OkResponse<Request>(request);
//}
public async Task<Response<Request>> Build(
HttpRequestMessage httpRequestMessage,
bool isQos,