mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
In aspnet-prerendering, parse the incoming querystring before passing it to the boot func for convenience. Fixes #638.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aspnet-prerendering",
|
"name": "aspnet-prerendering",
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
"description": "Helpers for server-side rendering of JavaScript applications in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
|
"description": "Helpers for server-side rendering of JavaScript applications in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ export function createServerRenderer(bootFunc: BootFunc): RenderToStringFunc {
|
|||||||
});
|
});
|
||||||
const parsedAbsoluteRequestUrl = url.parse(absoluteRequestUrl);
|
const parsedAbsoluteRequestUrl = url.parse(absoluteRequestUrl);
|
||||||
const params: BootFuncParams = {
|
const params: BootFuncParams = {
|
||||||
location: url.parse(requestPathAndQuery),
|
// It's helpful for boot funcs to receive the query as a key-value object, so parse it here
|
||||||
|
// e.g., react-redux-router requires location.query to be a key-value object for consistency with client-side behaviour
|
||||||
|
location: url.parse(requestPathAndQuery, /* parseQueryString */ true),
|
||||||
origin: parsedAbsoluteRequestUrl.protocol + '//' + parsedAbsoluteRequestUrl.host,
|
origin: parsedAbsoluteRequestUrl.protocol + '//' + parsedAbsoluteRequestUrl.host,
|
||||||
url: requestPathAndQuery,
|
url: requestPathAndQuery,
|
||||||
baseUrl: (requestPathBase || '') + '/',
|
baseUrl: (requestPathBase || '') + '/',
|
||||||
|
|||||||
Reference in New Issue
Block a user