Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
2921582
Fix conflict between param and exact path (#2706)
g1eny0ung May 19, 2021
d7091e7
README.md update (#2715)
yugu2day May 19, 2021
e72e584
chore(docs): bump to v1.7.2 (#2724)
appleboy May 19, 2021
afb3839
optimize code (#2722)
tylitianrui May 22, 2021
f13e53b
upgrade validator to v10.6.1 (#2729)
likakuli May 23, 2021
168edca
Check multipart file header size on test (#2716)
y-yagi May 23, 2021
f07a4f8
Upgrade github.com/ugorji/go/codec (#2732)
sunshineplan May 24, 2021
328d0b8
Fixed typo in documentation (#2733)
Don2Quixote May 24, 2021
b5ca989
set engine.TrustedProxies For items that don't use gin.RUN (#2692)
yiranzai May 25, 2021
0cbb30a
Update default validator's docs link (#2738)
iamhesir May 26, 2021
6703dea
Get client IP when using Cloudflare (#2723)
ItalyPaleAle May 28, 2021
97a32b1
Optimize code adjust (#2700)
daheige Jun 1, 2021
34ce210
optimize code and reduce code cyclomatic complexity (#2737)
tylitianrui Jun 3, 2021
61a0cda
Update tree.go (#2659)
youzeliang Jun 22, 2021
a8857ed
updated comments for Get function for params (#2756)
imaskm Jun 23, 2021
fb8a113
ci: add github action workflows (#2596)
laojianzi Jun 23, 2021
dd8a27c
Setting trusted platform using an enum-like (#2739)
ItalyPaleAle Jun 24, 2021
be860ec
fix typo and add comments (#2760)
zihengCat Jun 24, 2021
09f6cff
skip unnecessary variable assignment in timeFormat (#2761)
zihengCat Jun 24, 2021
7834a03
gin.Context with fallback value from gin.Context.Request.Context() (#…
wei840222 Jun 24, 2021
f2bbdfe
Use buf.String() instead of string(buf.Bytes()) (#2764)
zihengCat Jun 25, 2021
1d0f938
Fix insufficient slice check (#2755)
mamil Jun 25, 2021
e3ee01d
improve sliceValidateError.Error performance using switch and strings…
zihengCat Jun 28, 2021
690aa2b
feat(binding): support custom struct tag (#2720)
mtt0 Jun 29, 2021
372cc4a
Fix typo (#2772)
lancoLiu Jul 2, 2021
9c27053
byte alignment (#2774)
lancoLiu Jul 4, 2021
9d2883e
update the version of validator in the comment (#2780)
helios741 Jul 6, 2021
c7a28f8
use bit shift operation instead of division (#2776)
zihengCat Jul 6, 2021
3116a2d
use std http method constant instead of raw string (#2782)
zihengCat Jul 9, 2021
f96678c
use assert1 func (#2783)
lancoLiu Jul 11, 2021
caf2802
Improve router group tests (#2787)
zihengCat Jul 13, 2021
d4ca9a0
fix #2762 (#2767)
qm012 Jul 22, 2021
0a55865
fix #2786 (#2796)
qm012 Jul 26, 2021
11aa11a
fix readability in recovery test (#2797)
xerenahmed Jul 26, 2021
9a575a4
fallback Context.Deadline() Context.Done() Context.Err() to Context.R…
wei840222 Jul 31, 2021
6ebb945
docs: release v1.7.3 (#2802)
appleboy Aug 3, 2021
b463b1c
Update README.md (#2804)
goqihoo Aug 11, 2021
435a76b
chore(ci): update dependencies (#2827)
mmorel-35 Aug 19, 2021
a46dee3
Update .golangci.yml (#2829)
mmorel-35 Aug 19, 2021
f3a6b69
Delete unused static const (#2830)
sashamelentyev Aug 20, 2021
527d950
Delete unused arg (#2834)
sashamelentyev Aug 21, 2021
c303020
bump golangci-lint (#2839)
sashamelentyev Aug 21, 2021
8200903
Delete deadcode exclude rules (#2838)
sashamelentyev Aug 21, 2021
dfc25f9
Add short func with named return (#2837)
sashamelentyev Aug 22, 2021
4e75841
minor tweaks,optimize code (#2788)
lancoLiu Aug 22, 2021
30cdbfc
Bump github.com/goccy/go-json from 0.7.6 to 0.7.7 (#2849)
dependabot[bot] Aug 31, 2021
e4c026e
Fix go1.17 test error (#2856)
thinkerou Sep 6, 2021
a550c56
chore: Add go1.17 for testing (#2828)
appleboy Sep 6, 2021
abcf32f
Bump github.com/goccy/go-json from 0.7.7 to 0.7.8 (#2859)
dependabot[bot] Sep 6, 2021
5c62979
bump golangci-lint version (#2858)
sashamelentyev Sep 6, 2021
deb83b6
gin.Context.SetParam shortcut for e2e tests (#2848)
filikos Sep 7, 2021
eab47b5
fix: check obj type in protobufBinding (#2851)
Tevic Sep 7, 2021
ae349b4
Fix typo (#2860)
wssccc Sep 7, 2021
3a6f18f
fixed SetOutput() panics on go 1.17 (#2861)
cookieY Sep 8, 2021
71f7087
golangci(lint) : more linters (#2870)
mmorel-35 Sep 21, 2021
e052bf3
Bump github.com/json-iterator/go from 1.1.11 to 1.1.12 (#2865)
dependabot[bot] Sep 21, 2021
ef16867
Correcting grammatical errors in README file (#2880)
aravinth2094 Sep 28, 2021
d6534cc
turn on HandleMethodNotAllowed when using NoMethod #2871 (#2872)
togettoyou Sep 28, 2021
f469c1b
Add gosec (#2882)
sashamelentyev Sep 28, 2021
97b3c0d
Fix grammatical and spelling errors in context.go (#2883)
joeADSP Sep 28, 2021
6d75aba
Quick Fix c.ClientIP() mistakely parsing to 127.0.0.1 for who not usi…
Bisstocuz Sep 29, 2021
1a2bc0e
setted typo fix: There’s no such word as `setted`, `set` is set, set,…
axiaoxin Sep 30, 2021
3918132
Tidy: Complete TrustedProxies feature (#2887)
Bisstocuz Oct 6, 2021
21125bb
Bump github.com/goccy/go-json from 0.7.8 to 0.7.9 (#2891)
dependabot[bot] Oct 6, 2021
5929d52
ClientIP: check every proxy for trustiness (#2844)
agmt Oct 9, 2021
464535f
Bump github.com/goccy/go-json from 0.7.9 to 0.7.10 (#2905)
dependabot[bot] Oct 18, 2021
34ae777
README.md: fix a typo (#2913)
kulong0105 Oct 22, 2021
3fe9289
Update the code logic for latestNode in tree.go (#2897)
zhuxi0511 Oct 23, 2021
2d3d6d2
Provide custom options of TrustedPlatform for another CDN services (#…
Bisstocuz Oct 24, 2021
eb75ce0
adjust the routergroup Any method (#2701)
daheige Oct 24, 2021
1c2aa59
fix the misplacement of adding slashes (#2847)
citizen233 Oct 26, 2021
d4e72a1
Fix typo (#2926)
chutommy Oct 31, 2021
cbdd47a
fix tsr with mixed static and wildcard paths (#2924)
ibraheemdev Nov 1, 2021
efa3175
Update version.go (#2923)
AydenHex Nov 1, 2021
89a159b
Bump golangci-lint version (#2929)
sashamelentyev Nov 3, 2021
6aee456
Fix grammar (#2933)
zero11-0203 Nov 11, 2021
57ede9c
Export struct sliceValidateError to allow error casting and rename it…
edebernis Nov 21, 2021
4d7c4ec
chore(docs): Bump to v1.7.7 (#2952)
Bisstocuz Nov 24, 2021
823adfc
fix: typo (#2958)
jincheng9 Nov 25, 2021
ffb3b73
fix: description error (#2961)
jincheng9 Nov 26, 2021
f068099
Update README.md (#2954)
Nov 28, 2021
a06d546
prettify error message for catch-all conflict with existing path segm…
SericaLaw Nov 28, 2021
bc2417f
fix: description error (#2968)
jincheng9 Nov 30, 2021
830a63d
fix: typo (#2973)
jincheng9 Dec 2, 2021
0be805a
TrustedProxies: Add default IPv6 support and refactor (#2967)
Bisstocuz Dec 3, 2021
504ec59
fix:typo (#2975)
jincheng9 Dec 3, 2021
ba7e589
fix: typo (#2977)
jincheng9 Dec 5, 2021
3973c77
Bump github.com/goccy/go-json from 0.7.10 to 0.8.1 (#2981)
dependabot[bot] Dec 7, 2021
e56d18f
Update README.md (#2985)
chipmunktail Dec 11, 2021
7d18981
fix: wrong when wildcard follows named param (#2983)
jincheng9 Dec 12, 2021
fb5f045
fix: description error (#2986)
jincheng9 Dec 15, 2021
92a988d
fix: description error (#2988)
jincheng9 Dec 18, 2021
8a0f95c
fix: typo (#2993)
jincheng9 Dec 20, 2021
1538ece
Update README.md (#2997)
chipmunktail Dec 22, 2021
d062a6a
docs: redirect to the correct line of code (#2998)
jincheng9 Dec 26, 2021
0136319
fix: typo (#3006)
jincheng9 Jan 2, 2022
94153d1
test: expose performRequest func (#3012)
appleboy Jan 2, 2022
6868ed1
Bump github.com/go-playground/validator/v10 from 10.9.0 to 10.10.0 (#…
dependabot[bot] Jan 8, 2022
336ce0d
Bump github.com/goccy/go-json from 0.8.1 to 0.9.0 (#3021)
dependabot[bot] Jan 11, 2022
1b28e2b
Fix typo (#3023)
jarodsong6 Jan 12, 2022
2f6e124
Merge branch 'gin-gonic:master' into master
mtt0 Jan 18, 2022
c8902c0
Bump github.com/goccy/go-json from 0.9.0 to 0.9.3
dependabot[bot] Jan 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- With pull requests:
- Open your pull request against `master`
- Your pull request should have no more than two commits, if not you should squash them.
- It should pass all tests in the available continuous integration systems such as TravisCI.
- It should pass all tests in the available continuous integration systems such as GitHub Actions.
- You should add/modify tests to cover your proposed code changes.
- If your pull request contains a new feature, please document it on the README.

10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
84 changes: 84 additions & 0 deletions .github/workflows/gin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Run Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: '^1.16'
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.43.0
args: --verbose
test:
needs: lint
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go: [1.13, 1.14, 1.15, 1.16, 1.17]
test-tags: ['', nomsgpack]
include:
- os: ubuntu-latest
go-build: ~/.cache/go-build
- os: macos-latest
go-build: ~/Library/Caches/go-build
name: ${{ matrix.os }} @ Go ${{ matrix.go }} ${{ matrix.test-tags }}
runs-on: ${{ matrix.os }}
env:
GO111MODULE: on
TESTTAGS: ${{ matrix.test-tags }}
GOPROXY: https://proxy.golang.org
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}

- name: Checkout Code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- uses: actions/cache@v2
with:
path: |
${{ matrix.go-build }}
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Run Tests
run: make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
flags: ${{ matrix.os }},go-${{ matrix.go }},${{ matrix.test-tags }}
notification-gitter:
needs: test
runs-on: ubuntu-latest
steps:
- name: Notification failure message
if: failure()
run: |
PR_OR_COMPARE="$(if [ "${{ github.event.pull_request }}" != "" ]; then echo "${{ github.event.pull_request.html_url }}"; else echo "${{ github.event.compare }}"; fi)"
curl -d message="GitHub Actions [$GITHUB_REPOSITORY]($PR_OR_COMPARE) ($GITHUB_REF) [normal]($GITHUB_API_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) ($GITHUB_RUN_NUMBER)" -d level=error https://webhooks.gitter.im/e/7f95bf605c4d356372f4
- name: Notification success message
if: success()
run: |
PR_OR_COMPARE="$(if [ "${{ github.event.pull_request }}" != "" ]; then echo "${{ github.event.pull_request.html_url }}"; else echo "${{ github.event.compare }}"; fi)"
curl -d message="GitHub Actions [$GITHUB_REPOSITORY]($PR_OR_COMPARE) ($GITHUB_REF) [normal]($GITHUB_API_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) ($GITHUB_RUN_NUMBER)" https://webhooks.gitter.im/e/7f95bf605c4d356372f4
39 changes: 39 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
run:
timeout: 5m
linters:
enable:
- asciicheck
- depguard
- dogsled
- durationcheck
- errcheck
- errorlint
- exportloopref
- gci
- gofmt
- goimports
- gosec
- misspell
- nakedret
- nilerr
- nolintlint
- revive
- wastedassign
issues:
exclude-rules:
- linters:
- structcheck
- unused
text: "`data` is unused"
- linters:
- staticcheck
text: "SA1019:"
- linters:
- revive
text: "var-naming:"
- linters:
- revive
text: "exported:"
- path: _test\.go
linters:
- gosec # security is not make sense in tests
52 changes: 0 additions & 52 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ People and companies, who have contributed, in alphabetical order.
- Fix typo in comment


**@jincheng9 (Jincheng Zhang)**
- ★ support TSR when wildcard follows named param
- Fix errors and typos in comments


**@joiggama (Ignacio Galindo)**
- Add utf-8 charset header on renders

Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Gin ChangeLog

## Gin v1.7.7

### BUGFIXES

* Fixed X-Forwarded-For unsafe handling of CVE-2020-28483 [#2844](https://github.com/gin-gonic/gin/pull/2844), closed issue [#2862](https://github.com/gin-gonic/gin/issues/2862).
* Tree: updated the code logic for `latestNode` [#2897](https://github.com/gin-gonic/gin/pull/2897), closed issue [#2894](https://github.com/gin-gonic/gin/issues/2894) [#2878](https://github.com/gin-gonic/gin/issues/2878).
* Tree: fixed the misplacement of adding slashes [#2847](https://github.com/gin-gonic/gin/pull/2847), closed issue [#2843](https://github.com/gin-gonic/gin/issues/2843).
* Tree: fixed tsr with mixed static and wildcard paths [#2924](https://github.com/gin-gonic/gin/pull/2924), closed issue [#2918](https://github.com/gin-gonic/gin/issues/2918).

### ENHANCEMENTS

* TrustedProxies: make it backward-compatible [#2887](https://github.com/gin-gonic/gin/pull/2887), closed issue [#2819](https://github.com/gin-gonic/gin/issues/2819).
* TrustedPlatform: provide custom options for another CDN services [#2906](https://github.com/gin-gonic/gin/pull/2906).

### DOCS

* NoMethod: added usage annotation ([#2832](https://github.com/gin-gonic/gin/pull/2832#issuecomment-929954463)).

## Gin v1.7.6

### BUGFIXES

* bump new release to fix v1.7.5 release error by using v1.7.4 codes.

## Gin v1.7.4

### BUGFIXES

* bump new release to fix checksum mismatch

## Gin v1.7.3

### BUGFIXES

* fix level 1 router match [#2767](https://github.com/gin-gonic/gin/issues/2767), [#2796](https://github.com/gin-gonic/gin/issues/2796)

## Gin v1.7.2

### BUGFIXES

* Fix conflict between param and exact path [#2706](https://github.com/gin-gonic/gin/issues/2706). Close issue [#2682](https://github.com/gin-gonic/gin/issues/2682) [#2696](https://github.com/gin-gonic/gin/issues/2696).

## Gin v1.7.1

### BUGFIXES
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
- With pull requests:
- Open your pull request against `master`
- Your pull request should have no more than two commits, if not you should squash them.
- It should pass all tests in the available continuous integration systems such as TravisCI.
- It should pass all tests in the available continuous integration systems such as GitHub Actions.
- You should add/modify tests to cover your proposed code changes.
- If your pull request contains a new feature, please document it on the README.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
GO ?= go
GOFMT ?= gofmt "-s"
GO_VERSION=$(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
PACKAGES ?= $(shell $(GO) list ./...)
VETPACKAGES ?= $(shell $(GO) list ./... | grep -v /examples/)
GOFILES := $(shell find . -name "*.go")
Expand Down Expand Up @@ -67,5 +68,10 @@ misspell:

.PHONY: tools
tools:
go install golang.org/x/lint/golint; \
go install github.com/client9/misspell/cmd/misspell;
@if [ $(GO_VERSION) -gt 15 ]; then \
$(GO) install golang.org/x/lint/golint@latest; \
$(GO) install github.com/client9/misspell/cmd/misspell@latest; \
elif [ $(GO_VERSION) -lt 16 ]; then \
$(GO) install golang.org/x/lint/golint; \
$(GO) install github.com/client9/misspell/cmd/misspell; \
fi
Loading