mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 09:22:15 +00:00
fix(cloud): route the hosted assistant through its private gateway
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { safeFetch, safeFetchLlm } from '../../utils/ssrfGuard';
|
||||
import { safeFetch, safeFetchAdminConfigured, safeFetchLlm } from '../../utils/ssrfGuard';
|
||||
import type { AiChatClient } from './ai-chat-client.interface';
|
||||
import { AI_BASE_URLS, ownServerChatBase } from './ai-connections.constants';
|
||||
import type { ResolvedAiConnection } from './ai-connections.types';
|
||||
@@ -16,7 +16,9 @@ import { Injectable } from '@nestjs/common';
|
||||
* is the adapter's.
|
||||
*/
|
||||
const cloudFetch: AiFetch = (url, init) => safeFetch(url, { ...init, signal: init.signal }, { maxBytes: null });
|
||||
const hostedFetch: AiFetch = (url, init) => cloudFetch(url, { ...init, redirect: 'error' });
|
||||
|
||||
/** The operator's HTTPS gateway can resolve to its private proxy inside the tenant network. */
|
||||
const hostedFetch: AiFetch = (url, init) => safeFetchAdminConfigured(url, init, 0, undefined, null);
|
||||
|
||||
/**
|
||||
* An admin's own server, which may sit on loopback or in the LAN: the guard
|
||||
|
||||
Reference in New Issue
Block a user