Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: wrong when wildcard follows named param#2983

Merged
appleboy merged 6 commits into
gin-gonic:masterfrom
jincheng9:master
Dec 12, 2021
Merged

fix: wrong when wildcard follows named param#2983
appleboy merged 6 commits into
gin-gonic:masterfrom
jincheng9:master

Conversation

@jincheng9

@jincheng9 jincheng9 commented Dec 9, 2021

Copy link
Copy Markdown
Contributor

Description

  1. set route rule "/vendor/:x/*y"
  2. request via url "/vendor/x/", Gin returns 200. This is right.
  3. request via url "/vendor/x", Gin returns 404. Instead, it should redirect "/vendor/x" to match the rule "vendor/:x/*y"

References

This bug is fixed by the httprouter fix

@thinkerou please help review this PR. Thanks.

@codecov

codecov Bot commented Dec 9, 2021

Copy link
Copy Markdown

Codecov Report

Merging #2983 (c1f7be7) into master (e56d18f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2983   +/-   ##
=======================================
  Coverage   98.60%   98.60%           
=======================================
  Files          41       41           
  Lines        3084     3084           
=======================================
  Hits         3041     3041           
  Misses         30       30           
  Partials       13       13           
Flag Coverage Δ
go-1.13 ∅ <ø> (∅)
go-1.14 ∅ <ø> (∅)
go-1.15 ∅ <ø> (∅)
go-1.16 98.60% <100.00%> (ø)
go-1.17 98.50% <100.00%> (ø)
macos-latest 98.60% <100.00%> (ø)
nomsgpack 98.58% <100.00%> (ø)
ubuntu-latest 98.60% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tree.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e56d18f...c1f7be7. Read the comment docs.

@jincheng9

Copy link
Copy Markdown
Contributor Author

@appleboy @thinkerou Hi, please help review this PR. Thanks~

@thinkerou thinkerou added this to the v1.8 milestone Dec 11, 2021

@thinkerou thinkerou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jincheng9

Copy link
Copy Markdown
Contributor Author

@appleboy Plz help review this PR. Thanks.

@appleboy appleboy merged commit 7d18981 into gin-gonic:master Dec 12, 2021
daheige pushed a commit to daheige/gin that referenced this pull request Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants