-
Notifications
You must be signed in to change notification settings - Fork 549
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
[Bug][API] project check url encoding #8169
Comments
The issue you're experiencing with URL encoding in the However, since the problem occurs only in your dev environment and not on localhost, there might be differences in configuration or middleware that affect URL handling. Check if there are any discrepancies in the CORS or authentication middleware settings between the two environments [1][2]. Additionally, ensure that the server in the dev environment is configured to handle encoded URLs properly. You might want to verify any reverse proxy settings or server configurations that could be affecting the request path. If these suggestions don't resolve the issue, consider debugging the request handling in the dev environment to see how the path is being interpreted. |
I'll check with my platform team on these questions |
also i am facing this on my devlake, unable to load data from branches that contains slashes "/" |
As a follow-up to my earlier comment, I asked my platform team about this issue, and they confirmed our internal platform is not normalizing At this time, my team has decided to change our project name delimiter from forward slashes ( I'll keep the issue open, as it seems at least one other person is facing the same issue. |
Thanks for reporting the issue, to be triaged. |
This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs. |
This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future. |
Search before asking
What happened
We're rolling out DORA metrics at my company and we chose to use a forward slash (
/
) as a delimiter in our project naming convention. For example,team/ci/app
.I wrote a Python script to onboard projects to DevLake and part of the logic includes checking to see if the project already exists. The
/check
endpoint doesn't seem to not be handling url encoding the way I'd expect.Here's a sample curl request
curl http://localhost:8080/api/rest/projects/team%2Fci%2Fapp/check -H "Authorization: Bearer <token>"
The API response returns a 404 HTTP error:
404 page not found
What do you expect to happen
I'd expect the API response to return a json object as described in the API docs
How to reproduce
Make a call to the
/check
endpoint with a project name using%2F
to delimit a project name such asteam/ci/app
Sample curl request:
curl http://localhost:8080/api/rest/projects/team%2Fci%2Fapp/check -H "Authorization: Bearer <token>"
Anything else
The error seems to only be happening in our dev environment. Localhost seems to be handling this scenario without any issues.
Further, the error only happens when I substitute a forward slash (
/
) for%2F
. Single word project names seem to be handled okay in dev.I think I tracked down the functions responsible:
incubator-devlake/backend/server/services/project.go
Lines 421 to 431 in f99d5bd
incubator-devlake/backend/server/api/project/project.go
Lines 36 to 75 in f99d5bd
Version
v1.0.1@e061ef2
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: