mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 08:08:14 +08:00
* #555 added some tests for this issue but struggling to replicate * #555 removed cmd=instance from service fabric code as someone who knows service fabric says its not needed I * #555 renamed test
This commit is contained in:
@ -117,24 +117,12 @@ namespace Ocelot.DownstreamUrlCreator.Middleware
|
||||
{
|
||||
var query = context.DownstreamRequest.Query;
|
||||
var serviceFabricPath = $"/{context.DownstreamReRoute.ServiceName + dsPath.Data.Value}";
|
||||
|
||||
if (RequestForStatefullService(query))
|
||||
{
|
||||
return (serviceFabricPath, query);
|
||||
}
|
||||
|
||||
var split = string.IsNullOrEmpty(query) ? "?" : "&";
|
||||
return (serviceFabricPath, $"{query}{split}cmd=instance");
|
||||
return (serviceFabricPath, query);
|
||||
}
|
||||
|
||||
private static bool ServiceFabricRequest(DownstreamContext context)
|
||||
{
|
||||
return context.Configuration.ServiceProviderConfiguration.Type == "ServiceFabric" && context.DownstreamReRoute.UseServiceDiscovery;
|
||||
}
|
||||
|
||||
private static bool RequestForStatefullService(string query)
|
||||
{
|
||||
return query.Contains("PartitionKind") && query.Contains("PartitionKey");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user