From 36deecacfda1fca822abb0ef7802724234d205a3 Mon Sep 17 00:00:00 2001 From: Anya Stasiuk Date: Tue, 3 Nov 2020 12:56:55 +0200 Subject: [PATCH] fix: remove duplicated slash if hideHostname option enabled --- src/components/Endpoint/Endpoint.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Endpoint/Endpoint.tsx b/src/components/Endpoint/Endpoint.tsx index 9e9a5f92..5de8f6ac 100644 --- a/src/components/Endpoint/Endpoint.tsx +++ b/src/components/Endpoint/Endpoint.tsx @@ -67,6 +67,7 @@ export class Endpoint extends React.Component { const normalizedUrl = options.expandDefaultServerVariables ? expandDefaultServerVariables(server.url, server.variables) : server.url; + const basePath = getBasePath(normalizedUrl) === '/' ? '' : getBasePath(normalizedUrl); return ( @@ -74,7 +75,7 @@ export class Endpoint extends React.Component { {hideHostname || options.hideHostname - ? getBasePath(normalizedUrl) + ? basePath : normalizedUrl} {operation.path}