[filebrowser] fix: preserve OFS File Browser routes across login redirects - #4351
Open
smengcl wants to merge 1 commit into
Open
[filebrowser] fix: preserve OFS File Browser routes across login redirects#4351smengcl wants to merge 1 commit into
smengcl wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Hue login redirects for deep links whose route data is embedded in the path (not the query string), specifically File Browser OFS routes like .../filebrowser/view=ofs%3A%2F%2F..., by avoiding double-encoding introduced by request.get_full_path() + quote().
Changes:
- Add
_get_request_target()helper to build redirect targets from decodedrequest.pathplus the rawQUERY_STRING, then quote once for thenext=parameter. - Update the login redirect construction in
RequireLoginEverywhereMiddleware.process_view()to use the new helper. - Add regression tests ensuring OFS route delimiters and already-encoded query values are preserved across login redirects.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
desktop/core/src/desktop/middleware.py |
Refactors redirect target generation to prevent route corruption by constructing a stable path+query target before quoting. |
desktop/core/src/desktop/require_login_test.py |
Adds regression coverage for OFS deep link and encoded query-string preservation through the login redirect. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
smengcl
force-pushed
the
fix/hue-ofs-login-redirect
branch
from
July 20, 2026 15:50
25631a6 to
e56e6ec
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.
What changes were proposed in this pull request?
Fixes login redirects for Hue File Browser deep links containing OFS paths: #4350
When an unauthenticated user opens an OFS URL such as:
signing in previously redirected them to a corrupted
view%3Dofs://...route. Hue then treated the route as an HDFS path and displayed the misleading error:Root cause
request.get_full_path()already escapes characters in the path. Passing that result throughquote()encoded the existing percent sign again:After authentication, one encoded layer remained and changed the File Browser route.
Proposed Fix
Build the redirect target from:
The completed target is then quoted exactly once. This preserves the existing HTTP 302 login flow while retaining OFS route delimiters and already-encoded query values.
How was this patch tested?
gethue/hue:20250101-140101with an Apache Ozone 2.1.1 cluster and Ozone HttpFS.