Skip to content
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

路由无法正确匹配 #4119

Open
Mericusta opened this issue Dec 19, 2024 · 0 comments
Open

路由无法正确匹配 #4119

Mericusta opened this issue Dec 19, 2024 · 0 comments

Comments

@Mericusta
Copy link

  • With issues:
    • Use the search tool before opening a new issue.
    • Please provide source code and commit sha if you found a bug.
    • Review existing issues and provide feedback or react to them.

Description

路由无法正确匹配

How to reproduce

package main

import (
	"github.com/gin-gonic/gin"
)

func main() {
	g := gin.Default()
	g.POST("/mount/:mode/:env/:servers/:behavior/:begin_player_id/:end_player_id/:mount_delay/:monitor", func(c *gin.Context) {
		c.String(200, "Hello1")
	})
        g.POST("/inspect/:mode/:env/:servers/:behavior/:player_id", func(c *gin.Context) {
		c.String(200, "Hello2")
	})
	g.Run(":9000")
}

Expectations

$ curl -X POST http://localhost:9000/mount/linear/local/1/common/101/101/100/true
Hello1

Actual result

$ curl -X POST http://127.0.0.1:3344/mount/linear/local/1/common/101/101/100/true
Hello2

经常出现 Hello2 -> Frequently
偶尔出现 Hello1 -> Occasionally
将 "/inspect/:mode/:env/:servers/:behavior/:player_id" 修改为 "/inspect/local/:game_servers/:robot_behavior/:player_id" 则完全正确
modify "/inspect/:mode/:env/:servers/:behavior/:player_id" to "/inspect/local/:game_servers/:robot_behavior/:player_id" is ok

Environment

  • go version: go1.23.1 darwin/arm64
  • gin version (or commit ref): v1.9.1
  • operating system: MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant