Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Add HTTP Status Code to Shortcuts #4490

Merged
merged 6 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Neos.Neos/Classes/Controller/Frontend/NodeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ class NodeController extends ActionController
#[Flow\Inject]
protected RenderingModeService $renderingModeService;

#[Flow\InjectConfiguration(path: "frontend.shortcutRedirectHttpStatusCode", package: "Neos.Neos")]
protected int $shortcutRedirectHttpStatusCode;

/**
* @param string $node Legacy name for backwards compatibility of route components
* @throws NodeNotFoundException
Expand Down Expand Up @@ -299,7 +302,8 @@ protected function handleShortcutNode(NodeAddress $nodeAddress, ContentRepositor
} else {
$resolvedUri = $resolvedTarget;
}
$this->redirectToUri($resolvedUri);

$this->redirectToUri($resolvedUri, statusCode: $this->shortcutRedirectHttpStatusCode);
}

private function fillCacheWithContentNodes(
Expand Down
4 changes: 4 additions & 0 deletions Neos.Neos/Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Neos:
label: 'Neos.Neos:Main:nodeTypes.groups.plugins'
collapsed: true

frontend:
# HTTP Status Code used for redirecting Neos.Neos:Shortcut to target
shortcutRedirectHttpStatusCode: 303

userInterface:

# Switch on to see all translated labels getting scrambled. You now can localize
Expand Down
Loading