{"action":"closed","number":202,"pull_request":{"url":"https://api.github.com/repos/gin-gonic/gin/pulls/202","id":28414155,"html_url":"https://github.com/gin-gonic/gin/pull/202","diff_url":"https://github.com/gin-gonic/gin/pull/202.diff","patch_url":"https://github.com/gin-gonic/gin/pull/202.patch","issue_url":"https://api.github.com/repos/gin-gonic/gin/issues/202","number":202,"state":"closed","locked":false,"title":"Fix named parameter handle bugs","user":{"login":"superalsrk","id":1984063,"avatar_url":"https://avatars.githubusercontent.com/u/1984063?v=3","gravatar_id":"","url":"https://api.github.com/users/superalsrk","html_url":"https://github.com/superalsrk","followers_url":"https://api.github.com/users/superalsrk/followers","following_url":"https://api.github.com/users/superalsrk/following{/other_user}","gists_url":"https://api.github.com/users/superalsrk/gists{/gist_id}","starred_url":"https://api.github.com/users/superalsrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superalsrk/subscriptions","organizations_url":"https://api.github.com/users/superalsrk/orgs","repos_url":"https://api.github.com/users/superalsrk/repos","events_url":"https://api.github.com/users/superalsrk/events{/privacy}","received_events_url":"https://api.github.com/users/superalsrk/received_events","type":"User","site_admin":false},"body":"In current gin version, if we use demo like this\r\n\r\n```go\r\nfunc main() {\r\n    r := gin.Default()\r\n    // If no other routers match /user/john, it will redirect to /user/join/\r\n    r.GET(\"/user/:name/*action\", func(c *gin.Context) {\r\n        name := c.Params.ByName(\"name\")\r\n        action := c.Params.ByName(\"action\")\r\n        message := name + \" is \" + action\r\n        c.String(200, message)\r\n    })\r\n\r\n    // Listen and server on 0.0.0.0:8080\r\n    r.Run(\":8080\")\r\n}\r\n```\r\n\r\nIt cannot handle request **/user/john**, but it could handle **/user/john/**, and the demo is extrally copied from the readme, the  actually reason that why the demo in readme can handle **/user/john**  is that it's handled by\r\n\r\n```go\r\n  r.GET(\"/user/:name\", func(c *gin.Context) {\r\n        name := c.Params.ByName(\"name\")\r\n        message := \"Hello \"+name\r\n        c.String(200, message)\r\n    })\r\n```\r\n\r\nnot the\r\n\r\n```go\r\n r.GET(\"/user/:name/*action\", func(c *gin.Context) {\r\n        name := c.Params.ByName(\"name\")\r\n        action := c.Params.ByName(\"action\")\r\n        message := name + \" is \" + action\r\n        c.String(200, message)\r\n    })\r\n```\r\n\r\nFortunately， the latest [httprouter](https://github.com/julienschmidt/httprouter) solve this problem, if url like **/user/john** cannot be handled by other routers, it will redirect 301 to **/user/john/**\r\n","created_at":"2015-01-31T12:21:00Z","updated_at":"2015-02-07T13:34:33Z","closed_at":"2015-02-07T13:34:33Z","merged_at":"2015-02-07T13:34:33Z","merge_commit_sha":"661ba8854cf5dfb7c31990355decc37dd7b1ed90","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gin-gonic/gin/pulls/202/commits","review_comments_url":"https://api.github.com/repos/gin-gonic/gin/pulls/202/comments","review_comment_url":"https://api.github.com/repos/gin-gonic/gin/pulls/comments/{number}","comments_url":"https://api.github.com/repos/gin-gonic/gin/issues/202/comments","statuses_url":"https://api.github.com/repos/gin-gonic/gin/statuses/d2c369995722ee93b380f80f23cacbb7ac38d2e3","head":{"label":"superalsrk:develop","ref":"develop","sha":"d2c369995722ee93b380f80f23cacbb7ac38d2e3","user":{"login":"superalsrk","id":1984063,"avatar_url":"https://avatars.githubusercontent.com/u/1984063?v=3","gravatar_id":"","url":"https://api.github.com/users/superalsrk","html_url":"https://github.com/superalsrk","followers_url":"https://api.github.com/users/superalsrk/followers","following_url":"https://api.github.com/users/superalsrk/following{/other_user}","gists_url":"https://api.github.com/users/superalsrk/gists{/gist_id}","starred_url":"https://api.github.com/users/superalsrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superalsrk/subscriptions","organizations_url":"https://api.github.com/users/superalsrk/orgs","repos_url":"https://api.github.com/users/superalsrk/repos","events_url":"https://api.github.com/users/superalsrk/events{/privacy}","received_events_url":"https://api.github.com/users/superalsrk/received_events","type":"User","site_admin":false},"repo":{"id":30110310,"name":"gin","full_name":"superalsrk/gin","owner":{"login":"superalsrk","id":1984063,"avatar_url":"https://avatars.githubusercontent.com/u/1984063?v=3","gravatar_id":"","url":"https://api.github.com/users/superalsrk","html_url":"https://github.com/superalsrk","followers_url":"https://api.github.com/users/superalsrk/followers","following_url":"https://api.github.com/users/superalsrk/following{/other_user}","gists_url":"https://api.github.com/users/superalsrk/gists{/gist_id}","starred_url":"https://api.github.com/users/superalsrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superalsrk/subscriptions","organizations_url":"https://api.github.com/users/superalsrk/orgs","repos_url":"https://api.github.com/users/superalsrk/repos","events_url":"https://api.github.com/users/superalsrk/events{/privacy}","received_events_url":"https://api.github.com/users/superalsrk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/superalsrk/gin","description":"Gin is a web framework written in Golang. It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.","fork":true,"url":"https://api.github.com/repos/superalsrk/gin","forks_url":"https://api.github.com/repos/superalsrk/gin/forks","keys_url":"https://api.github.com/repos/superalsrk/gin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/superalsrk/gin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/superalsrk/gin/teams","hooks_url":"https://api.github.com/repos/superalsrk/gin/hooks","issue_events_url":"https://api.github.com/repos/superalsrk/gin/issues/events{/number}","events_url":"https://api.github.com/repos/superalsrk/gin/events","assignees_url":"https://api.github.com/repos/superalsrk/gin/assignees{/user}","branches_url":"https://api.github.com/repos/superalsrk/gin/branches{/branch}","tags_url":"https://api.github.com/repos/superalsrk/gin/tags","blobs_url":"https://api.github.com/repos/superalsrk/gin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/superalsrk/gin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/superalsrk/gin/git/refs{/sha}","trees_url":"https://api.github.com/repos/superalsrk/gin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/superalsrk/gin/statuses/{sha}","languages_url":"https://api.github.com/repos/superalsrk/gin/languages","stargazers_url":"https://api.github.com/repos/superalsrk/gin/stargazers","contributors_url":"https://api.github.com/repos/superalsrk/gin/contributors","subscribers_url":"https://api.github.com/repos/superalsrk/gin/subscribers","subscription_url":"https://api.github.com/repos/superalsrk/gin/subscription","commits_url":"https://api.github.com/repos/superalsrk/gin/commits{/sha}","git_commits_url":"https://api.github.com/repos/superalsrk/gin/git/commits{/sha}","comments_url":"https://api.github.com/repos/superalsrk/gin/comments{/number}","issue_comment_url":"https://api.github.com/repos/superalsrk/gin/issues/comments/{number}","contents_url":"https://api.github.com/repos/superalsrk/gin/contents/{+path}","compare_url":"https://api.github.com/repos/superalsrk/gin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/superalsrk/gin/merges","archive_url":"https://api.github.com/repos/superalsrk/gin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/superalsrk/gin/downloads","issues_url":"https://api.github.com/repos/superalsrk/gin/issues{/number}","pulls_url":"https://api.github.com/repos/superalsrk/gin/pulls{/number}","milestones_url":"https://api.github.com/repos/superalsrk/gin/milestones{/number}","notifications_url":"https://api.github.com/repos/superalsrk/gin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/superalsrk/gin/labels{/name}","releases_url":"https://api.github.com/repos/superalsrk/gin/releases{/id}","created_at":"2015-01-31T11:22:12Z","updated_at":"2015-01-31T12:06:16Z","pushed_at":"2015-01-31T12:06:16Z","git_url":"git://github.com/superalsrk/gin.git","ssh_url":"git@github.com:superalsrk/gin.git","clone_url":"https://github.com/superalsrk/gin.git","svn_url":"https://github.com/superalsrk/gin","homepage":"https://gin-gonic.github.io/gin/","size":695,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"gin-gonic:develop","ref":"develop","sha":"2d1291329a909e85c7a3cd762bb9e064601b2824","user":{"login":"gin-gonic","id":7894478,"avatar_url":"https://avatars.githubusercontent.com/u/7894478?v=3","gravatar_id":"","url":"https://api.github.com/users/gin-gonic","html_url":"https://github.com/gin-gonic","followers_url":"https://api.github.com/users/gin-gonic/followers","following_url":"https://api.github.com/users/gin-gonic/following{/other_user}","gists_url":"https://api.github.com/users/gin-gonic/gists{/gist_id}","starred_url":"https://api.github.com/users/gin-gonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gin-gonic/subscriptions","organizations_url":"https://api.github.com/users/gin-gonic/orgs","repos_url":"https://api.github.com/users/gin-gonic/repos","events_url":"https://api.github.com/users/gin-gonic/events{/privacy}","received_events_url":"https://api.github.com/users/gin-gonic/received_events","type":"Organization","site_admin":false},"repo":{"id":20904437,"name":"gin","full_name":"gin-gonic/gin","owner":{"login":"gin-gonic","id":7894478,"avatar_url":"https://avatars.githubusercontent.com/u/7894478?v=3","gravatar_id":"","url":"https://api.github.com/users/gin-gonic","html_url":"https://github.com/gin-gonic","followers_url":"https://api.github.com/users/gin-gonic/followers","following_url":"https://api.github.com/users/gin-gonic/following{/other_user}","gists_url":"https://api.github.com/users/gin-gonic/gists{/gist_id}","starred_url":"https://api.github.com/users/gin-gonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gin-gonic/subscriptions","organizations_url":"https://api.github.com/users/gin-gonic/orgs","repos_url":"https://api.github.com/users/gin-gonic/repos","events_url":"https://api.github.com/users/gin-gonic/events{/privacy}","received_events_url":"https://api.github.com/users/gin-gonic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gin-gonic/gin","description":"Gin is a web framework written in Golang. It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.","fork":false,"url":"https://api.github.com/repos/gin-gonic/gin","forks_url":"https://api.github.com/repos/gin-gonic/gin/forks","keys_url":"https://api.github.com/repos/gin-gonic/gin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gin-gonic/gin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gin-gonic/gin/teams","hooks_url":"https://api.github.com/repos/gin-gonic/gin/hooks","issue_events_url":"https://api.github.com/repos/gin-gonic/gin/issues/events{/number}","events_url":"https://api.github.com/repos/gin-gonic/gin/events","assignees_url":"https://api.github.com/repos/gin-gonic/gin/assignees{/user}","branches_url":"https://api.github.com/repos/gin-gonic/gin/branches{/branch}","tags_url":"https://api.github.com/repos/gin-gonic/gin/tags","blobs_url":"https://api.github.com/repos/gin-gonic/gin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gin-gonic/gin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gin-gonic/gin/git/refs{/sha}","trees_url":"https://api.github.com/repos/gin-gonic/gin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gin-gonic/gin/statuses/{sha}","languages_url":"https://api.github.com/repos/gin-gonic/gin/languages","stargazers_url":"https://api.github.com/repos/gin-gonic/gin/stargazers","contributors_url":"https://api.github.com/repos/gin-gonic/gin/contributors","subscribers_url":"https://api.github.com/repos/gin-gonic/gin/subscribers","subscription_url":"https://api.github.com/repos/gin-gonic/gin/subscription","commits_url":"https://api.github.com/repos/gin-gonic/gin/commits{/sha}","git_commits_url":"https://api.github.com/repos/gin-gonic/gin/git/commits{/sha}","comments_url":"https://api.github.com/repos/gin-gonic/gin/comments{/number}","issue_comment_url":"https://api.github.com/repos/gin-gonic/gin/issues/comments/{number}","contents_url":"https://api.github.com/repos/gin-gonic/gin/contents/{+path}","compare_url":"https://api.github.com/repos/gin-gonic/gin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gin-gonic/gin/merges","archive_url":"https://api.github.com/repos/gin-gonic/gin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gin-gonic/gin/downloads","issues_url":"https://api.github.com/repos/gin-gonic/gin/issues{/number}","pulls_url":"https://api.github.com/repos/gin-gonic/gin/pulls{/number}","milestones_url":"https://api.github.com/repos/gin-gonic/gin/milestones{/number}","notifications_url":"https://api.github.com/repos/gin-gonic/gin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gin-gonic/gin/labels{/name}","releases_url":"https://api.github.com/repos/gin-gonic/gin/releases{/id}","created_at":"2014-06-16T23:57:25Z","updated_at":"2015-02-07T13:34:33Z","pushed_at":"2015-02-07T13:34:32Z","git_url":"git://github.com/gin-gonic/gin.git","ssh_url":"git@github.com:gin-gonic/gin.git","clone_url":"https://github.com/gin-gonic/gin.git","svn_url":"https://github.com/gin-gonic/gin","homepage":"https://gin-gonic.github.io/gin/","size":1746,"stargazers_count":2138,"watchers_count":2138,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":188,"mirror_url":null,"open_issues_count":41,"forks":188,"open_issues":41,"watchers":2138,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/gin-gonic/gin/pulls/202"},"html":{"href":"https://github.com/gin-gonic/gin/pull/202"},"issue":{"href":"https://api.github.com/repos/gin-gonic/gin/issues/202"},"comments":{"href":"https://api.github.com/repos/gin-gonic/gin/issues/202/comments"},"review_comments":{"href":"https://api.github.com/repos/gin-gonic/gin/pulls/202/comments"},"review_comment":{"href":"https://api.github.com/repos/gin-gonic/gin/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/gin-gonic/gin/pulls/202/commits"},"statuses":{"href":"https://api.github.com/repos/gin-gonic/gin/statuses/d2c369995722ee93b380f80f23cacbb7ac38d2e3"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"javierprovecho","id":2457529,"avatar_url":"https://avatars.githubusercontent.com/u/2457529?v=3","gravatar_id":"","url":"https://api.github.com/users/javierprovecho","html_url":"https://github.com/javierprovecho","followers_url":"https://api.github.com/users/javierprovecho/followers","following_url":"https://api.github.com/users/javierprovecho/following{/other_user}","gists_url":"https://api.github.com/users/javierprovecho/gists{/gist_id}","starred_url":"https://api.github.com/users/javierprovecho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javierprovecho/subscriptions","organizations_url":"https://api.github.com/users/javierprovecho/orgs","repos_url":"https://api.github.com/users/javierprovecho/repos","events_url":"https://api.github.com/users/javierprovecho/events{/privacy}","received_events_url":"https://api.github.com/users/javierprovecho/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":3,"deletions":2,"changed_files":2}}