From b3e0d154bd2959894b6e1aee98519fd7ccd7a3d9 Mon Sep 17 00:00:00 2001 From: Lucas Morgan Date: Tue, 17 May 2022 07:21:45 -0500 Subject: [PATCH] Fix swagger json route for hosting. --- Gameboard.ShogiUI.Sockets/Startup.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Gameboard.ShogiUI.Sockets/Startup.cs b/Gameboard.ShogiUI.Sockets/Startup.cs index c735d0e..cb857d0 100644 --- a/Gameboard.ShogiUI.Sockets/Startup.cs +++ b/Gameboard.ShogiUI.Sockets/Startup.cs @@ -180,6 +180,12 @@ namespace Gameboard.ShogiUI.Sockets ClientId = "c1e94676-cab0-42ba-8b6c-9532b8486fff", UsePkceWithAuthorizationCodeGrant = true }; + config.TransformToExternalPath = (route, request) => + { + return request.Host.HasValue && request.Host.Value.Contains("localhost") + ? route + : $"/Gameboard.ShogiUI.Sockets{route}"; + }; //config.WithCredentials = true; }) .UseWebSockets(socketOptions)