Skip to content

Commit

Permalink
feat(router): allow to generate OCS URL for a given base (current ins…
Browse files Browse the repository at this point in the history
…tance by default)

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Jan 23, 2024
1 parent 8800e7a commit e3c586b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ export const generateOcsUrl = (url: string, params?: object, options?: UrlOption
ocsVersion: 2
}, options || {})

const version = (allOptions.ocsVersion === 1) ? 1 : 2
const version = (allOptions.ocsVersion === 1) ? 1 : 2
const baseUrl = options?.remoteBase || getBaseUrl()

return getBaseUrl() + '/ocs/v' + version + '.php' + _generateUrlPath(url, params, options);
return baseUrl + '/ocs/v' + version + '.php' + _generateUrlPath(url, params, options);
}

export interface UrlOptions {
escape: boolean,
noRewrite: boolean,
ocsVersion: Number
ocsVersion: Number,
remoteBase: String,
}

/**
Expand Down

0 comments on commit e3c586b

Please sign in to comment.