Skip to content

Commit 1f26164

Browse files
jacob-thetalakemrin9
authored andcommitted
Include port if it is present
1 parent db2be89 commit 1f26164

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/templates/security-scheme-template.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ 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.protocol}://${url.hostname}`;
267+
const baseUrl = url.port === ''
268+
? `${url.protocol}://${url.hostname}`
269+
: `${url.protocol}://${url.hostname}:${url.port}`;
268270

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

0 commit comments

Comments
 (0)