Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 56c806b

Browse files
Update aspnet-prerendering to 3.0.1, fixing the default "fetch" base URL to match the real application root URL
1 parent 8acba88 commit 56c806b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Microsoft.AspNetCore.SpaServices/npm/aspnet-prerendering/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aspnet-prerendering",
3-
"version": "2.0.6",
3+
"version": "3.0.1",
44
"description": "Helpers for server-side rendering of JavaScript applications in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
55
"main": "index.js",
66
"scripts": {
@@ -17,7 +17,7 @@
1717
"url": "https://github.com/aspnet/JavaScriptServices.git"
1818
},
1919
"dependencies": {
20-
"domain-task": "^2.0.2"
20+
"domain-task": "^3.0.0"
2121
},
2222
"devDependencies": {
2323
"@types/node": "^6.0.42",

src/Microsoft.AspNetCore.SpaServices/npm/aspnet-prerendering/src/Prerendering.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export function createServerRenderer(bootFunc: BootFunc): RenderToStringFunc {
2626
domainTasks: domainTaskCompletionPromise,
2727
data: customDataParameter
2828
};
29+
const absoluteBaseUrl = params.origin + params.baseUrl; // Should be same value as page's <base href>
2930

3031
// Open a new domain that can track all the async tasks involved in the app's execution
3132
domainTaskRun(/* code to run */ () => {
@@ -35,7 +36,7 @@ export function createServerRenderer(bootFunc: BootFunc): RenderToStringFunc {
3536
bindPromiseContinuationsToDomain(domainTaskCompletionPromise, domain['active']);
3637

3738
// Make the base URL available to the 'domain-tasks/fetch' helper within this execution context
38-
domainTaskBaseUrl(absoluteRequestUrl);
39+
domainTaskBaseUrl(absoluteBaseUrl);
3940

4041
// Begin rendering, and apply a timeout
4142
const bootFuncPromise = bootFunc(params);

0 commit comments

Comments
 (0)