Skip to content

Commit

Permalink
Remove querystring from exposed URL
Browse files Browse the repository at this point in the history
  • Loading branch information
antograssiot committed Apr 19, 2019
1 parent 5dd5d6d commit ffb186d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Endpoint/Endpoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Markdown } from '../Markdown/Markdown';
import { OptionsContext } from '../OptionsProvider';
import { SelectOnClick } from '../SelectOnClick/SelectOnClick';

import { getBasePath } from '../../utils';
import {getBasePath, getOrigin} from '../../utils';
import {
EndpointInfo,
HttpVerb,
Expand Down Expand Up @@ -68,7 +68,7 @@ export class Endpoint extends React.Component<EndpointProps, EndpointState> {
<span>
{hideHostname || options.hideHostname
? getBasePath(server.url)
: server.url}
: getOrigin(server.url)}
</span>
{operation.path}
</ServerUrl>
Expand Down
4 changes: 4 additions & 0 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,7 @@ export function resolveUrl(url: string, to: string) {
export function getBasePath(serverUrl: string): string {
return new URL(serverUrl).pathname;
}

export function getOrigin(serverUrl: string): string {
return new URL(serverUrl).origin;
}

0 comments on commit ffb186d

Please sign in to comment.