Skip to content

Commit

Permalink
Fix server redirect for external URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffersonBledsoe committed Nov 29, 2024
1 parent fe08438 commit 2374d2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/volto/src/components/theme/View/LinkView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import { Container as SemanticContainer } from 'semantic-ui-react';

const LinkView = ({ token, content }) => {
if (!token && content.remoteUrl) {
if (isInternalURL(content.remoteUrl)) {
// React router can handle all redirects except for client-side to an external URL.
if (isInternalURL(content.remoteUrl) || __SERVER__) {
return <Redirect to={flattenToAppURL(content.remoteUrl)} />;
}
window.location.href = flattenToAppURL(content.remoteUrl);
window.location.href = content.remoteUrl;
return null;
}
const { title, description, remoteUrl } = content;
Expand Down

0 comments on commit 2374d2a

Please sign in to comment.