diff --git a/src/components/Endpoint/Endpoint.tsx b/src/components/Endpoint/Endpoint.tsx index 00d7bda060..bc7863d4c8 100644 --- a/src/components/Endpoint/Endpoint.tsx +++ b/src/components/Endpoint/Endpoint.tsx @@ -5,7 +5,7 @@ import { Markdown } from '../Markdown/Markdown'; import { OptionsContext } from '../OptionsProvider'; import { SelectOnClick } from '../SelectOnClick/SelectOnClick'; -import { getBasePath } from '../../utils'; +import {getBasePath, removeQueryString} from '../../utils'; import { EndpointInfo, HttpVerb, @@ -68,7 +68,7 @@ export class Endpoint extends React.Component { {hideHostname || options.hideHostname ? getBasePath(server.url) - : server.url} + : removeQueryString(server.url)} {operation.path} diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 699d3da523..210748f44c 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -165,3 +165,9 @@ export function resolveUrl(url: string, to: string) { export function getBasePath(serverUrl: string): string { return new URL(serverUrl).pathname; } + +export function removeQueryString(serverUrl: string): string { + const url = new URL(serverUrl); + url.search = ''; + return url.toString(); +}