Merge pull request #1000 from GNS3/API-requests-doesn't-use-HTTPS-when-SSL-is-configured

Api requests doesn't use https when ssl is configured
This commit is contained in:
piotrpekala7 2020-10-17 00:29:58 +02:00 committed by GitHub
commit fc34cbf524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -48,4 +48,3 @@
<button mat-button (click)="onAddClick()" tabindex="2" mat-raised-button color="primary">Add</button>
</div>
</form>

View File

@ -177,7 +177,13 @@ export class HttpServer {
private getOptionsForServer<T extends HeadersOptions>(server: Server, url: string, options: T) {
if (server.host && server.port) {
url = `http://${server.host}:${server.port}/v2${url}`;
if (server.authorization === 'basic') {
url = `https://${server.host}:${server.port}/v2${url}`;
console.log(url);
} else {
url = `http://${server.host}:${server.port}/v2${url}`;
console.log(url);
}
} else {
url = `/v2${url}`;
}