From 4729fc3d8fc83f4af087cd7932adf500b45bab4e Mon Sep 17 00:00:00 2001 From: Anna Stasiuk Date: Tue, 3 Nov 2020 14:47:23 +0200 Subject: [PATCH] fix: remove duplicated slash if hideHostname option enabled (#1448) --- src/components/Endpoint/Endpoint.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Endpoint/Endpoint.tsx b/src/components/Endpoint/Endpoint.tsx index 9e9a5f92..9579eeca 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); return ( @@ -74,7 +75,9 @@ export class Endpoint extends React.Component { {hideHostname || options.hideHostname - ? getBasePath(normalizedUrl) + ? basePath === '/' + ? '' + : basePath : normalizedUrl} {operation.path}