Skip to content

Commit ba7bcb2

Browse files
jacob-thetalakemrin9
authored andcommitted
Update to use url.origin
1 parent 1f26164 commit ba7bcb2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/templates/security-scheme-template.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,7 @@ function oAuthFlowTemplate(flowName, clientId, clientSecret, securitySchemeId, a
264264
const isUrlAbsolute = (url) => (url.indexOf('://') > 0 || url.indexOf('//') === 0);
265265
// Calculcate base URL
266266
const url = new URL(this.selectedServer.computedUrl);
267-
const baseUrl = url.port === ''
268-
? `${url.protocol}://${url.hostname}`
269-
: `${url.protocol}://${url.hostname}:${url.port}`;
267+
const baseUrl = url.origin;
270268

271269
if (refreshUrl && !isUrlAbsolute(refreshUrl)) {
272270
refreshUrl = `${baseUrl}/${refreshUrl.replace(/^\//, '')}`;

0 commit comments

Comments
 (0)