mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 08:38:14 +08:00
Fixed some unit tests
This commit is contained in:
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user