From 1c3ff97525a63e6d559226c59c408b19db31e893 Mon Sep 17 00:00:00 2001 From: Burgyn Date: Thu, 28 May 2020 07:12:51 +0200 Subject: [PATCH] Add scheme to server path --- .../Middleware/SwaggerForOcelotMiddleware.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MMLib.SwaggerForOcelot/Middleware/SwaggerForOcelotMiddleware.cs b/src/MMLib.SwaggerForOcelot/Middleware/SwaggerForOcelotMiddleware.cs index 2fb303c..279669a 100644 --- a/src/MMLib.SwaggerForOcelot/Middleware/SwaggerForOcelotMiddleware.cs +++ b/src/MMLib.SwaggerForOcelot/Middleware/SwaggerForOcelotMiddleware.cs @@ -70,7 +70,8 @@ public async Task Invoke(HttpContext context, ISwaggerServiceDiscoveryProvider d string serverName; if (string.IsNullOrWhiteSpace(_options.ServerOcelot)) { - serverName = EndPoint.HostOverride ?? context.Request.Host.Value.RemoveSlashFromEnd(); + serverName = EndPoint.HostOverride + ?? $"{context.Request.Scheme}://{context.Request.Host.Value.RemoveSlashFromEnd()}"; } else {