Limit redirects to dashboard defined route#1709
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR scopes client-side precaching and server-side redirect handling to the configured base path only.
- Update Service Worker to use a
denylistfor dev mode and trailing-slash URLs under/dashboard - Scope the Express redirect middleware to
config.pathand adjust URL construction
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ui/src/sw.js | Replaces allowlist with denylist, prevents precaching in dev and for trailing-slash dashboard URLs |
| nodes/config/ui_base.js | Scopes the trailing-slash redirect middleware to config.path and prefixes redirect URLs accordingly |
Comments suppressed due to low confidence (1)
ui/src/sw.js:12
- This JSDoc refers to
allowlistwhich has been removed; update this annotation to referencedenylistor remove it if it's no longer necessary.
/** @type {RegExp[] | undefined} */
joepavitt
approved these changes
May 21, 2025
joepavitt
left a comment
Contributor
There was a problem hiding this comment.
Verified and working locally
Contributor
|
I ran the E2E's locally just to be sure there isn't anything funky going on, and 2 x form tests are failing here too. Investigating further before merging and getting the new release out. |
2621eb8 to
9e09dfb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #1708
Description
config.pathto scope the redirect middlewareallowListto adenyListto prevent pre-caching of URLs where the pathname part contains a trailing slash - so that it hits the backend to be handled by the server.Related Issue(s)
#1708
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel