mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 02:40:14 +01:00
🌐 fix(actions): Correct URL Formation for Subdomains in createURL (#3149)
This commit is contained in:
parent
cec2e57ee9
commit
b2b469bd3d
2 changed files with 48 additions and 3 deletions
|
|
@ -32,8 +32,10 @@ export function sha1(input: string) {
|
|||
}
|
||||
|
||||
export function createURL(domain: string, path: string) {
|
||||
const myURL = new URL(path, domain);
|
||||
return myURL.toString();
|
||||
const cleanDomain = domain.replace(/\/$/, '');
|
||||
const cleanPath = path.replace(/^\//, '');
|
||||
const fullURL = `${cleanDomain}/${cleanPath}`;
|
||||
return new URL(fullURL).toString();
|
||||
}
|
||||
|
||||
export class FunctionSignature {
|
||||
|
|
@ -92,7 +94,7 @@ export class ActionRequest {
|
|||
private authHeaders: Record<string, string> = {};
|
||||
private authToken?: string;
|
||||
|
||||
async setParams(params: object) {
|
||||
setParams(params: object) {
|
||||
this.operationHash = sha1(JSON.stringify(params));
|
||||
this.params = params;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue