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
This commit is contained in:
Keen Yee Liau
2020-10-19 15:23:37 -07:00
committed by Andrew Kushnir
parent d33eaa64a2
commit 7768aeb62f
4 changed files with 119 additions and 24 deletions

View File

@ -3,6 +3,7 @@ export declare const BEFORE_APP_SERIALIZED: InjectionToken<(() => void | Promise
export declare const INITIAL_CONFIG: InjectionToken<PlatformConfig>;
export declare interface PlatformConfig {
baseUrl?: string;
document?: string;
url?: string;
useAbsoluteUrl?: boolean;