Keen Yee Liau 7768aeb62f fix(platform-server): Resolve absolute URL from baseUrl (#39334)
This commit fixes a bug when `useAbsoluteUrl` is set to true and
`ServerPlatformLocation` infers the base url from the supplied
`url`. User should explicitly set the `baseUrl` when they turn on
`useAbsoluteUrl`.

Breaking change:
If you use `useAbsoluteUrl` to setup `platform-server`, you now need to
also specify `baseUrl`.
We are intentionally making this a breaking change in a minor release,
because if `useAbsoluteUrl` is set to `true` then the behavior of the
application could be unpredictable, resulting in issues that are hard to
discover but could be affecting production environments.

PR Close #39334
2020-10-21 09:41:58 -07:00

41 lines
1.1 KiB
TypeScript

export declare const BEFORE_APP_SERIALIZED: InjectionToken<(() => void | Promise<void>)[]>;
export declare const INITIAL_CONFIG: InjectionToken<PlatformConfig>;
export declare interface PlatformConfig {
baseUrl?: string;
document?: string;
url?: string;
useAbsoluteUrl?: boolean;
}
export declare const platformDynamicServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
export declare const platformServer: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
export declare class PlatformState {
constructor(_doc: any);
getDocument(): any;
renderToString(): string;
}
export declare function renderModule<T>(module: Type<T>, options: {
document?: string;
url?: string;
extraProviders?: StaticProvider[];
}): Promise<string>;
export declare function renderModuleFactory<T>(moduleFactory: NgModuleFactory<T>, options: {
document?: string;
url?: string;
extraProviders?: StaticProvider[];
}): Promise<string>;
export declare class ServerModule {
}
export declare class ServerTransferStateModule {
}
export declare const VERSION: Version;