mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 16:13:06 +00:00
fix: remove trailing slash from url if needed
This commit is contained in:
@@ -16,7 +16,7 @@ import {Logger} from '@openstapps/logger';
|
||||
import * as commander from 'commander';
|
||||
import {readFileSync} from 'fs';
|
||||
import {join} from 'path';
|
||||
import { URL } from 'url';
|
||||
import {URL} from 'url';
|
||||
import {copy} from './copy';
|
||||
import {HttpClient} from './httpClient';
|
||||
|
||||
|
||||
@@ -98,6 +98,9 @@ export class Client {
|
||||
* TODO: remove headers/version
|
||||
*/
|
||||
constructor(protected httpClient: HttpClientInterface, protected url: string, protected version?: string) {
|
||||
// cut trailing slash if needed
|
||||
this.url = this.url.replace(/\/$/, '');
|
||||
|
||||
if (typeof version === 'string') {
|
||||
// set header to tell proxy to select the correct backend
|
||||
this.headers = {
|
||||
|
||||
Reference in New Issue
Block a user