We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8bdcd9 commit c82bf64Copy full SHA for c82bf64
packages/ai/src/chatTransport.ts
@@ -457,6 +457,8 @@ const BASE_URL_VALIDATION_ERRORS = {
457
credentials: "baseURL must not include username or password credentials",
458
} as const;
459
460
+const INTERNAL_WHITESPACE_REGEX = /\s/;
461
+
462
function resolvePayloadMapper<
463
UI_MESSAGE extends UIMessage,
464
PAYLOAD,
@@ -492,7 +494,7 @@ function normalizeBaseUrl(baseURL: string) {
492
494
}
493
495
496
function assertBaseUrlHasNoInternalWhitespace(baseUrl: string) {
- if (/\s/.test(baseUrl)) {
497
+ if (INTERNAL_WHITESPACE_REGEX.test(baseUrl)) {
498
throw new Error(BASE_URL_VALIDATION_ERRORS.containsWhitespace);
499
500
0 commit comments