fix: remove duplicated slash if hideHostname option enabled (#1448)

This commit is contained in:
Anna Stasiuk 2020-11-03 14:47:23 +02:00 committed by GitHub
parent 4567534cbb
commit 4729fc3d8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,6 +67,7 @@ export class Endpoint extends React.Component<EndpointProps, EndpointState> {
const normalizedUrl = options.expandDefaultServerVariables
? expandDefaultServerVariables(server.url, server.variables)
: server.url;
const basePath = getBasePath(normalizedUrl);
return (
<ServerItem key={normalizedUrl}>
<Markdown source={server.description || ''} compact={true} />
@ -74,7 +75,9 @@ export class Endpoint extends React.Component<EndpointProps, EndpointState> {
<ServerUrl>
<span>
{hideHostname || options.hideHostname
? getBasePath(normalizedUrl)
? basePath === '/'
? ''
: basePath
: normalizedUrl}
</span>
{operation.path}