Rename `locationHref` -> `locationUrl`
To better match the `canonicalUrl` option
This commit is contained in:
parent
fdfea1155c
commit
3edb1b4924
|
@ -69,14 +69,14 @@ async function _renderHydrogenToStringUnsafe(renderOptions) {
|
|||
assert(renderOptions.vmRenderScriptFilePath);
|
||||
assert(renderOptions.vmRenderContext);
|
||||
assert(renderOptions.pageOptions);
|
||||
assert(renderOptions.pageOptions.locationHref);
|
||||
assert(renderOptions.pageOptions.locationUrl);
|
||||
assert(renderOptions.pageOptions.cspNonce);
|
||||
|
||||
const { dom, vmContext } = createDomAndSetupVmContext();
|
||||
|
||||
// A small `window.location` stub
|
||||
if (!dom.window.location) {
|
||||
const locationUrl = new URL(renderOptions.pageOptions.locationHref);
|
||||
const locationUrl = new URL(renderOptions.pageOptions.locationUrl);
|
||||
dom.window.location = {};
|
||||
[
|
||||
'hash',
|
||||
|
|
|
@ -86,7 +86,7 @@ async function timeoutMiddleware(req, res, next) {
|
|||
title: `Server timeout - Matrix Public Archive`,
|
||||
description: `Unable to respond in time (${requestTimeoutMs / 1000}s)`,
|
||||
entryPoint: 'client/js/entry-client-timeout.js',
|
||||
locationHref: urlJoin(basePath, req.originalUrl),
|
||||
locationUrl: urlJoin(basePath, req.originalUrl),
|
||||
// We don't have a Matrix room so we don't know whether or not to index. Just choose
|
||||
// a safe-default of false.
|
||||
shouldIndex: false,
|
||||
|
|
|
@ -17,7 +17,7 @@ function clientSideRoomAliasHashRedirectRoute(req, res) {
|
|||
title: `Page not found - Matrix Public Archive`,
|
||||
description: `This page does not exist but we may be able to redirect you to the right place.`,
|
||||
entryPoint: 'client/js/entry-client-room-alias-hash-redirect.js',
|
||||
locationHref: urlJoin(basePath, req.originalUrl),
|
||||
locationUrl: urlJoin(basePath, req.originalUrl),
|
||||
// We don't have a Matrix room so we don't know whether or not to index. Just choose
|
||||
// a safe-default of false.
|
||||
shouldIndex: false,
|
||||
|
|
|
@ -78,7 +78,7 @@ router.get(
|
|||
description:
|
||||
'Browse thousands of rooms using Matrix. The new portal into the Matrix ecosystem.',
|
||||
entryPoint: 'client/js/entry-client-room-directory.js',
|
||||
locationHref: urlJoin(basePath, req.originalUrl),
|
||||
locationUrl: urlJoin(basePath, req.originalUrl),
|
||||
shouldIndex,
|
||||
cspNonce: res.locals.cspNonce,
|
||||
};
|
||||
|
|
|
@ -916,7 +916,7 @@ router.get(
|
|||
}),
|
||||
blockedBySafeSearch: isNsfw,
|
||||
entryPoint: 'client/js/entry-client-hydrogen.js',
|
||||
locationHref: urlJoin(basePath, req.originalUrl),
|
||||
locationUrl: urlJoin(basePath, req.originalUrl),
|
||||
canonicalUrl: matrixPublicArchiveURLCreator.archiveUrlForDate(
|
||||
roomIdOrAlias,
|
||||
new Date(toTimestamp),
|
||||
|
|
Loading…
Reference in New Issue