Skip to content

Commit faadafb

Browse files
authored
Merge pull request #932 from ringmaster217/issue-931
issue 931 fix
2 parents a694eed + 3c9e1b0 commit faadafb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/client.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@ SwaggerClient.prototype.buildFromSpec = function (response) {
346346
if (typeof this.url === 'string') {
347347
location = this.parseUri(this.url);
348348
if (typeof this.scheme === 'undefined' && typeof this.schemes === 'undefined' || this.schemes.length === 0) {
349+
if (typeof location !== 'undefined' && typeof(location.scheme) !== 'undefined') {
350+
this.scheme = location.scheme;
351+
}
349352
if(typeof window !== 'undefined' && typeof(window.location) !== 'undefined') {
350353
// use the window scheme
351354
this.scheme = window.location.protocol.replace(':','');

0 commit comments

Comments
 (0)