/
opt
/
canhelp
/
node_modules
/
better-auth
/
dist
/
utils
/
/opt/canhelp/node_modules/better-auth/dist/utils
mkdir
upload
Name
Size
Mode
Actions
boolean.mjs
177
0644
edit
dl
rm
boolean.mjs.map
271
0644
edit
dl
rm
constants.mjs
178
0644
edit
dl
rm
constants.mjs.map
219
0644
edit
dl
rm
date.mjs
208
0644
edit
dl
rm
date.mjs.map
363
0644
edit
dl
rm
get-request-ip.d.mts
263
0644
edit
dl
rm
get-request-ip.mjs
879
0644
edit
dl
rm
get-request-ip.mjs.map
1811
0644
edit
dl
rm
hashing.mjs
763
0644
edit
dl
rm
hashing.mjs.map
1296
0644
edit
dl
rm
hide-metadata.d.mts
184
0644
edit
dl
rm
hide-metadata.mjs
162
0644
edit
dl
rm
hide-metadata.mjs.map
234
0644
edit
dl
rm
index.d.mts
400
0644
edit
dl
rm
index.mjs
403
0644
edit
dl
rm
is-api-error.d.mts
234
0644
edit
dl
rm
is-api-error.mjs
348
0644
edit
dl
rm
is-api-error.mjs.map
536
0644
edit
dl
rm
is-atom.mjs
282
0644
edit
dl
rm
is-atom.mjs.map
573
0644
edit
dl
rm
is-promise.mjs
244
0644
edit
dl
rm
is-promise.mjs.map
454
0644
edit
dl
rm
middleware-response.mjs
273
0644
edit
dl
rm
middleware-response.mjs.map
544
0644
edit
dl
rm
password.mjs
1172
0644
edit
dl
rm
password.mjs.map
2224
0644
edit
dl
rm
plugin-helper.mjs
474
0644
edit
dl
rm
plugin-helper.mjs.map
829
0644
edit
dl
rm
shim.mjs
563
0644
edit
dl
rm
shim.mjs.map
1076
0644
edit
dl
rm
time.d.mts
1823
0644
edit
dl
rm
time.mjs
2358
0644
edit
dl
rm
time.mjs.map
4978
0644
edit
dl
rm
url.d.mts
3476
0644
edit
dl
rm
url.mjs
8295
0644
edit
dl
rm
url.mjs.map
15264
0644
edit
dl
rm
wildcard.mjs
4337
0644
edit
dl
rm
wildcard.mjs.map
9044
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/better-auth/dist/utils/url.d.mts
(3476B)
import { BaseURLConfig, DynamicBaseURLConfig } from "@better-auth/core"; //#region src/utils/url.d.ts declare function getBaseURL(url?: string, path?: string, request?: Request, loadEnv?: boolean, trustedProxyHeaders?: boolean | undefined): string | undefined; declare function getOrigin(url: string): string | null; declare function getProtocol(url: string): string | null; declare function getHost(url: string): string | null; /** * Checks if the baseURL config is a dynamic config object */ declare function isDynamicBaseURLConfig(config: BaseURLConfig | undefined): config is DynamicBaseURLConfig; /** * Extracts the host from the request headers. * Tries x-forwarded-host first (for proxy setups), then falls back to host header. * * @param request The incoming request * @returns The host string or null if not found */ declare function getHostFromRequest(request: Request): string | null; /** * Extracts the protocol from the request headers. * Tries x-forwarded-proto first (for proxy setups), then infers from request URL. * * @param request The incoming request * @param configProtocol Protocol override from config * @returns The protocol ("http" or "https") */ declare function getProtocolFromRequest(request: Request, configProtocol?: "http" | "https" | "auto" | undefined): "http" | "https"; /** * Matches a hostname against a host pattern. * Supports wildcard patterns like `*.vercel.app` or `preview-*.myapp.com`. * * @param host The hostname to test (e.g., "myapp.com", "preview-123.vercel.app") * @param pattern The host pattern (e.g., "myapp.com", "*.vercel.app") * @returns {boolean} true if the host matches the pattern, false otherwise. * * @example * ```ts * matchesHostPattern("myapp.com", "myapp.com") // true * matchesHostPattern("preview-123.vercel.app", "*.vercel.app") // true * matchesHostPattern("preview-123.myapp.com", "preview-*.myapp.com") // true * matchesHostPattern("evil.com", "myapp.com") // false * ``` */ declare const matchesHostPattern: (host: string, pattern: string) => boolean; /** * Resolves the base URL from a dynamic config based on the incoming request. * Validates the derived host against the allowedHosts allowlist. * * @param config The dynamic base URL config * @param request The incoming request * @param basePath The base path to append * @returns The resolved base URL with path * @throws BetterAuthError if host is not in allowedHosts and no fallback is set */ declare function resolveDynamicBaseURL(config: DynamicBaseURLConfig, request: Request, basePath: string): string; /** * Resolves the base URL from any config type (static string or dynamic object). * This is the main entry point for base URL resolution. * * @param config The base URL config (string or object) * @param basePath The base path to append * @param request Optional request for dynamic resolution * @param loadEnv Whether to load from environment variables * @param trustedProxyHeaders Whether to trust proxy headers (for legacy behavior) * @returns The resolved base URL with path */ declare function resolveBaseURL(config: BaseURLConfig | undefined, basePath: string, request?: Request, loadEnv?: boolean, trustedProxyHeaders?: boolean): string | undefined; //#endregion export { getBaseURL, getHost, getHostFromRequest, getOrigin, getProtocol, getProtocolFromRequest, isDynamicBaseURLConfig, matchesHostPattern, resolveBaseURL, resolveDynamicBaseURL }; //# sourceMappingURL=url.d.mts.map
Save
cmd:
run