Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ai company
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
ai company
Commits
6af0848f
Commit
6af0848f
authored
May 30, 2026
by
Admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update path rewrite middleware to support new flat routes
parent
99ee01c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
server.py
backend/server.py
+5
-8
No files found.
backend/server.py
View file @
6af0848f
...
@@ -182,15 +182,10 @@ class CompanyPathRewriteMiddleware:
...
@@ -182,15 +182,10 @@ class CompanyPathRewriteMiddleware:
company_id
=
match
.
group
(
2
)
company_id
=
match
.
group
(
2
)
resource_path
=
match
.
group
(
3
)
resource_path
=
match
.
group
(
3
)
# Only rewrite if it's one of the legacy compatibility paths
# Check if this is a path we should NOT rewrite (runs API expects prefix)
is_legacy
=
(
is_runs
=
resource_path
.
startswith
(
"runs"
)
resource_path
.
startswith
(
"skills"
)
or
resource_path
.
startswith
(
"members"
)
or
resource_path
.
startswith
(
"user-directory"
)
or
resource_path
.
startswith
(
"join-requests"
)
)
if
is_legacy
:
if
not
is_runs
:
if
resource_path
.
startswith
(
"skills"
):
if
resource_path
.
startswith
(
"skills"
):
resource_path
=
re
.
sub
(
r"^skills(\b|/)"
,
"company-skills
\\
1"
,
resource_path
)
resource_path
=
re
.
sub
(
r"^skills(\b|/)"
,
"company-skills
\\
1"
,
resource_path
)
elif
resource_path
.
startswith
(
"members"
):
elif
resource_path
.
startswith
(
"members"
):
...
@@ -199,6 +194,8 @@ class CompanyPathRewriteMiddleware:
...
@@ -199,6 +194,8 @@ class CompanyPathRewriteMiddleware:
resource_path
=
re
.
sub
(
r"^user-directory(\b|/)"
,
"company-memberships/user-directory
\\
1"
,
resource_path
)
resource_path
=
re
.
sub
(
r"^user-directory(\b|/)"
,
"company-memberships/user-directory
\\
1"
,
resource_path
)
elif
resource_path
.
startswith
(
"join-requests"
):
elif
resource_path
.
startswith
(
"join-requests"
):
resource_path
=
re
.
sub
(
r"^join-requests(\b|/)"
,
"company-memberships/join-requests
\\
1"
,
resource_path
)
resource_path
=
re
.
sub
(
r"^join-requests(\b|/)"
,
"company-memberships/join-requests
\\
1"
,
resource_path
)
elif
resource_path
.
startswith
(
"org"
):
resource_path
=
re
.
sub
(
r"^org(\b|/)"
,
"org-chart-svg
\\
1"
,
resource_path
)
# Rewrite path
# Rewrite path
scope
[
"path"
]
=
f
"{api_prefix}/{resource_path}"
scope
[
"path"
]
=
f
"{api_prefix}/{resource_path}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment