This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch kw-7217-project-name
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/kw-7217-project-name by this 
push:
     new 07e44ff52 docs: add comment explaing why router.UseRawPath is needed
07e44ff52 is described below

commit 07e44ff52ed5b71561831bacc39579d155002954
Author: Klesh Wong <[email protected]>
AuthorDate: Mon Apr 22 15:05:48 2024 +0800

    docs: add comment explaing why router.UseRawPath is needed
---
 backend/server/api/api.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/backend/server/api/api.go b/backend/server/api/api.go
index 45473976f..50f5ceb2d 100644
--- a/backend/server/api/api.go
+++ b/backend/server/api/api.go
@@ -93,8 +93,9 @@ func CreateApiServer() *gin.Engine {
 func SetupApiServer(router *gin.Engine) {
        // Set gin mode
        gin.SetMode(basicRes.GetConfig("MODE"))
+       // Required for `/projects/hello%20%2F%20world` to be parsed properly 
with `/projects/:projectName`
+       // end up with `name = "hello / world"`
        router.UseRawPath = true
-       // router.UnescapePathValues = false
 
        // Endpoint to proceed database migration
        router.GET("/proceed-db-migration", func(ctx *gin.Context) {

Reply via email to