Automated Preview URLs (#601)

This commit is contained in:
Steve Faulkner
2021-04-02 12:24:01 -05:00
committed by GitHub
parent ba24eabe7c
commit bd9bdad78a
10 changed files with 595 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ export const tokenProvider = async (requestInfo: RequestInfo) => {
};
export const requestPlugin: Cosmos.Plugin<any> = async (requestContext, next) => {
requestContext.endpoint = configContext.PROXY_PATH;
requestContext.endpoint = new URL(configContext.PROXY_PATH, window.location.href).href;
requestContext.headers["x-ms-proxy-target"] = endpoint();
return next(requestContext);
};