Canonical check

This commit is contained in:
Tom Moor
2019-01-19 00:51:25 -08:00
parent 77a8f54973
commit 72d8abe069

View File

@@ -167,10 +167,13 @@ class DocumentScene extends React.Component<Props> {
}
if (!this.revision) {
// Update url to match the current one
this.props.history.replace(
updateDocumentUrl(props.match.url, document.url)
const canonicalUrl = updateDocumentUrl(
props.match.url,
document.url
);
if (this.props.location !== canonicalUrl) {
this.props.history.replace(canonicalUrl);
}
}
}
} else {