1412 Commits

Author SHA1 Message Date
fj.jin
dd0547fb2d make it clear that the context will be reset after the request ends, otherwise, the timing of the pointer context reset is uncontrollable without constraints 2020-11-17 00:19:04 +08:00
An Xiao (Luffy)
7742ff50e0
Fix typos in context.go (#2551) 2020-11-11 09:41:35 +08:00
Alessandro (Ale) Segala
65ed60ed13
Allow bind with a map[string]string (#2484)
Co-authored-by: thinkerou <thinkerou@gmail.com>
2020-10-31 07:20:47 +08:00
thinkerou
16cd8cdd4e
ci: romove go1.11 for gin1.7 (#2540) 2020-10-25 17:08:30 +08:00
Peperoncino
7e444c6f59
upgrade go-validator to v10.4.1 (#2536) 2020-10-21 09:36:01 +08:00
Georges Varouchas
f969bfaf50
implement ".Unwrap() error" on Error type (#2525) (#2526)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: thinkerou <thinkerou@gmail.com>
2020-10-17 21:22:37 +08:00
xyb
c83a1cca0a
reduce allocs and improve the render WriteString (#2508)
Co-authored-by: yonbiaoxiao <yonbiaoxiao@tencent.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: thinkerou <thinkerou@gmail.com>
2020-10-16 18:32:33 +08:00
Zasda Yusuf Mikail
d541085b59
Add some missing dots on README (#2519)
Signed-off-by: Zasda Yusuf Mikail <zasdaym@gmail.com>

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-10-16 09:32:10 +08:00
Zach Newburgh
a7a6986d73
fix: print headers without Authorization header on broken pipe (#2528)
Co-authored-by: thinkerou <thinkerou@gmail.com>
2020-10-15 22:41:35 +08:00
xyb
1297966100
use IndexByte replace Split to improve performance (#2500)
Co-authored-by: yonbiaoxiao <yonbiaoxiao@tencent.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-10-15 13:55:57 +08:00
eudore
540b1eff70
update content-disposition header to MIME-style (#2512) 2020-09-25 09:45:17 +08:00
John Bampton
3100b7cb05
Fix spelling (#2498) 2020-09-14 10:40:20 +08:00
yugu
1f232c7f47
docs:close the body of the response (#2494) 2020-09-09 20:00:44 +08:00
Dennis Cho
b860d8672d
Fix typo (#2489) 2020-09-02 23:15:25 +08:00
kaiiak
0304ee96ed
Add GetUint and GetUint64 method on gin.context (#2487) 2020-09-01 09:33:54 +08:00
AllinGo
b94d23d1b4
support go 1.15 (#2463) 2020-08-12 09:28:51 +08:00
Florian Polster
815e1ce281
Prevent panic in Context.GetQuery() when there is no Request (#2412)
Co-authored-by: thinkerou <thinkerou@gmail.com>
2020-08-08 20:32:19 +08:00
lantw44
30b5f7e2d7
binding: avoid 2038 problem on 32-bit architectures (#2450)
Function setTimeField calls strconv.ParseInt with bit size 0 when
parsing Unix time, which means it is equivalent to specifying 32 on
32-bit architectures. This causes the function to suffer from the year
2038 problem. To fix it and keep the behavior the same on both 32-bit
and 64-bit architectures, explicitly specify bit size 64.

Co-authored-by: thinkerou <thinkerou@gmail.com>
2020-08-08 17:31:08 +08:00
John Bampton
cf8b583db4
Fix spelling (#2451) 2020-08-04 07:04:06 +08:00
森 優太
c6d6df6d5a
Docs: Update README.md Custom Validator sample code (#2448)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-08-01 15:26:29 +08:00
Hiroyuki Tanaka
44e78a78d4
README: Change badge to pkg.go.dev (#2449) 2020-08-01 15:03:33 +08:00
Johnny Dallas
4cabdd303f
Add CustomRecovery builtin middleware (#2322)
* Add CustomRecovery and CustomRecoveryWithWriter methods

* add CustomRecovery example to README

* add test for CustomRecovery

* support RecoveryWithWriter(io.Writer, ...RecoveryFunc)
2020-07-09 09:40:00 +08:00
Vas N
5e40c1d49c
DebugPrintRouteFunc() unit test (#2395)
Co-authored-by: thinkerou <thinkerou@gmail.com>
2020-05-25 21:47:06 +08:00
bestgopher
c9b8535817
Rename some variables (#2393) 2020-05-25 20:13:09 +08:00
Miles
5f261fa752
Add a redirect sample for POST method (#2389)
* Add a redirect sample for POST method

Refer to issue https://github.com/gin-gonic/gin/issues/444

* put an empty line before 1396

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-05-24 11:37:32 +08:00
bestgopher
9221381443
remove a unused type SecureJSONPrefix (#2391) 2020-05-24 10:58:28 +08:00
thinkerou
2773ce6e60
add copyright (#2388)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-05-23 22:52:01 +08:00
bestgopher
7bffae1d3d
Remove some functions that have the same effect as the bytes package (#2387) 2020-05-23 22:19:37 +08:00
Sudhir Mishra
acbb3d4f42
Broken link repo typo fix (#2381) 2020-05-18 15:50:35 +08:00
Bo-Yi Wu
b4c8bf1bbe
chore(performance): improve countParams (#2378)
* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: update

* chore: improve countParams performance

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: add comment
2020-05-17 18:11:22 +08:00
thinkerou
1d5b9badd9
chore: rename getQueryCache/getFormCache to initQueryCache/initFormCache (#2375) 2020-05-14 11:35:14 +08:00
vinhha96
a6e8665e42
fix(tree): reassign fullpath when register new node which the same current node (#2366)
* fix(tree): assign fullpath to current node by fullpath of new node if current node the same new node

* test(router-test): reverse the order when register router when test func GetFullPath

* chg(tree-test): update test case with register new route in TestRouteContextHoldsFullPath

Co-authored-by: vinhha <vinhha@vng.com.vn>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-05-11 13:25:49 +08:00
Bo-Yi Wu
d17270dd90
Sync route tree to httprouter latest code (#2368)
* update tree

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update countParams

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix testing

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* udpate

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix testing

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* refactor gin context

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* add fullPath

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: refactor

* remove unused code

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* remove varsCount

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* refactor

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-05-10 13:22:25 +08:00
Bo-Yi Wu
6f3d96ccff
chore: improve render string performance (#2365) 2020-05-09 17:41:00 +08:00
Anup Kumar Panwar
82b284fd77
uncomment the code (#2362) 2020-05-08 08:50:26 +08:00
bn4t
235898e642
Fix typo (#2358) 2020-05-05 23:20:00 +08:00
Bo-Yi Wu
05464a8f6b
docs: update benchmark result v1.6.3 (#2355) 2020-05-05 16:37:40 +08:00
thinkerou
747efffd2a
chore: update godoc address (#2357) 2020-05-05 14:06:42 +08:00
thinkerou
6ac7f194c4
chore: update some code style (#2356) 2020-05-05 13:55:57 +08:00
thinkerou
54175dbe72
chore: update the result of CR (#2354)
* chore: update the result of CR

* Update utils.go

* Update utils.go

* Update context.go

* Update context.go
2020-05-04 11:40:41 +08:00
Bo-Yi Wu
abc4fa0718
Release v1.6.3 version (#2353)
* chore: update version to v1.6.3

* update changelog

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-05-03 21:12:07 +08:00
Bo-Yi Wu
2c43278080
chore(performance): Change *sync.RWMutex to sync.RWMutex (#2351) 2020-05-03 20:39:34 +08:00
Ronald Petty
4427ca4a60
Update gin_integration_test.go (#2341)
* Update gin_integration_test.go

TestUnixSocket fails if you run it twice in a row.  This is due to the unix socket file persisting.  Added defer to clean up.

Whats unclear is the following test TestBadUnixSocket I suspect is just looking for cruft maybe from a prior test or defaults not working, I have not enough background to say.

* Update gin_integration_test.go

I believe there is some tab issue here, tried to manual overwrite it now.

* Update gin_integration_test.go

squash you dang spaces!!!
2020-04-28 09:36:04 +08:00
Qt
be4ba7d9df
update: CHANGELOG.md add log for version 1.6.2 (#2329) 2020-04-20 20:07:36 +08:00
Johnny Dallas
90fff292d7
fix typo in the PR template and CONTRIBUTING files (#2323)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-04-17 12:26:42 +08:00
bestgopher
a4e947a356
update:SetMode function (#2321) 2020-04-16 22:31:58 +08:00
Shilin Wang
4f208887e1
update set cookie example (#2312)
fix #2308
2020-04-08 23:31:31 +08:00
Henry Kwan
3315353c20
Update version.go (#2307)
sync to tag v1.6.2
2020-03-27 21:39:11 +08:00
Bo-Yi Wu
298ebca691
fix missing initial sync.RWMutex (#2305)
* fix missing initial sync.RWMutex

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* Add unit testing.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
v1.6.2
2020-03-27 10:57:36 +08:00
Bo-Yi Wu
57f99ca50f
Add set samesite in cookie. (#2306)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-03-27 10:47:22 +08:00