2023 Commits
Author SHA1 Message Date
Little FedyaandBo-Yi Wu 0f09c3a9b4 docs: include HTTP QUERY method in RouterGroup.Any (#4879)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-10-10 12:20:35 +08:00
ea9fab99e0 fix(tree): grow skippedNodes when pooled capacity is stale (#4852)
getValue resliced the backtrack stack to index+1 on the assumption that
its capacity equals Engine.maxSections. The pool captures that capacity
at allocation. Routes registered afterwards raise maxSections without
resizing the pooled slice. The next request that needs one more frame
panics inside the router, before Recovery.

append grows the slice when the captured capacity is short and preserves
the existing backtrack behaviour when it is already sufficient. The reset
at entry stays: getValue still runs once per method tree on the same stack.

Co-authored-by: hazyhaar <hazyhaarlabs@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-10-10 12:18:54 +08:00
adam magued e8f24969d5 feat(routergroup): include HTTP QUERY method in Any (#4878)
Signed-off-by: AdamMagued <adamismailmageud@gmail.com>
2026-10-10 12:16:17 +08:00
Zain QureshiandClaude Opus 5.5 43fe48e8a0 docs: fix SecureJSON default prefix and default-binding example output (#4861)
The SecureJSON docs and the Context.SecureJSON comment said the default
prefix is "while(1),". The engine sets secureJSONPrefix to "while(1);"
(gin.go), and the example output a few lines below already shows the
semicolon.

The default-values binding example printed a "Colors" field that the
Person struct does not have; the struct's array field is Addresses
with default "foo bar", which binds to ["foo","bar"].

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:14:45 +08:00
HazyLabandhazyhaar 1bd0ecf2d3 fix(context): load Keys under the mutex in Copy (#4854)
Copy read c.Keys before RLock. Set stores that field under Lock when the
map is created. The race detector reports the unsynchronized access, and
the copy can observe a nil header and drop keys Set has already published.

maps.Clone(nil) returns nil, so the load and the clone belong in the same
critical section. Map iteration was already under the mutex.

Co-authored-by: hazyhaar <hazyhaarlabs@gmail.com>
2026-09-25 14:01:37 +08:00
waterandBo-Yi Wu 3b08cd7235 fix: reset skipped-nodes stack on getValue entry to prevent slice overflow panic [#4818] (#4819)
* fix: reset skipped-nodes stack on getValue entry to prevent slice overflow panic [#4818]

* test: add regression test for getValue skipped-nodes overflow panic [#4818]

* test(gin): consolidate routing regression tests

- Move skipped-node regression cases into the existing routing test suite without changing behavior.

---------

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-09-19 21:11:32 +08:00
Ruben PariandBo-Yi Wu d8f2d588d7 fix(engine): add default ReadHeaderTimeout to http.Server in Run methods (#4800)
Engine.Run, RunTLS, and RunListener created an http.Server without
ReadHeaderTimeout, leaving applications exposed to slowloris-style
resource exhaustion. A new Engine.ReadHeaderTimeout field (default
10s) is now applied to the http.Server created by these methods.
Users can customize the value or use a custom http.Server for full
control.

Fixes #4760

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-09-19 14:41:53 +08:00
Wahid Rizka Fathurrohman 8ad9f9cbea docs: fix the graceful shutdown example (#4809)
The example calls errors.Is but never imports errors, so copying it as
written fails to build with "undefined: errors".

It also passes an unbuffered channel to signal.Notify, which go vet
reports as a misuse: signal delivery is non-blocking, so a signal that
arrives before the receive is dropped.
2026-09-19 14:21:21 +08:00
b1f77cf536 feat(gin): add support for the HTTP QUERY method (RFC 10008) (#4806)
* feat: add support for the HTTP QUERY method (RFC 10008)

Add a QUERY shortcut on RouterGroup, a gin.MethodQuery constant and a
gin.IQueryRoutes interface for callers that only hold an IRoutes value.

QUERY is deliberately kept out of IRoutes and out of Any:

- Adding a method to IRoutes would break every type outside of Gin that
  implements it, such as test doubles and wrappers.
- Leaving Any untouched keeps existing catch-all routes matching exactly
  the methods they matched before. Match([]string{gin.MethodQuery, ...})
  covers the case where QUERY is wanted alongside other methods.

MethodQuery is declared in Gin because the standard library does not
provide http.MethodQuery yet. The value stays correct once it does.

Ref #4721

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(router): remove duplicate QUERY method

- Consolidate QUERY into the existing router method after merging master
- Preserve the MethodQuery constant and request body documentation

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-09-19 14:20:37 +08:00
Bob DuandBo-Yi Wu 05b14df992 chore(deps): bump github.com/stretchr/testify to v1.12.1 (#4822)
Signed-off-by: Bob Du <i@bobdu.cc>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-09-19 14:12:33 +08:00
daixiheguuandBo-Yi Wu e318c6add8 docs: align function comments with names (#4814)
Signed-off-by: daixiheguu <daixihegu@outlook.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-09-19 14:10:49 +08:00
Bob DuandBo-Yi Wu 3329b63aa7 ci(codecov): fix stale comparison base and invalid config (#4823)
Signed-off-by: Bob Du <i@bobdu.cc>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-09-19 14:09:40 +08:00
Langning ZhangandBo-Yi Wu 5c6a15f8f9 fix(context): handle missing HTML renderer (#4805)
* fix(context): handle missing HTML renderer

* test(render): cover missing HTML renderer error

---------

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-09-16 23:01:52 +08:00
Bo-Yi Wu bc141b4dbf fix(deps)!: patch x/crypto vulnerabilities (#4832)
- Upgrade x/crypto and its required dependency versions
- Align documentation and CI with the required Go version

BREAKING CHANGE: Go 1.26 or later is now required by x/crypto v0.56.0. Upgrade the Go toolchain before building Gin.
2026-09-16 22:47:17 +08:00
Ruben Pari b52df1fe77 docs: document panic conditions in Handle, StaticFS, and Bind (#4797)
Handle panics on invalid HTTP method, StaticFS panics when relativePath
contains URL parameters, and Bind panics when given a pointer. These
panic conditions are reasonable startup-time guards but were not
documented, making the crash risk undiscoverable without reading source.

Fixes #4594
2026-09-16 21:26:35 +08:00
2a1a14ff37 feat(router): add QUERY method shortcut for RFC 10008 (#4830)
* feat(router): add QUERY method shortcut for RFC 10008

Add a QUERY() router method as a shortcut for Handle("QUERY", path, handlers),
following the same pattern as GET, POST, HEAD and other HTTP method shortcuts.

The QUERY method is defined by RFC 10008 and allows sending a query in the
request body, similar to GET but with a body. Go's net/http does not yet
expose an http.MethodQuery constant, so the literal string "QUERY" is used.

Closes #4721

* style(router): format QUERY method test

- Remove an extra blank line to satisfy gofmt.

---------

Co-authored-by: Jia-ben00 <316397950+Jia-ben00@users.noreply.github.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-09-16 21:24:33 +08:00
Amirhf dcaa4296d1 docs(path): fix malformed comment in cleanPath (#4723) 2026-08-15 13:44:19 +08:00
8dd20118ba fix(deps): bump golang.org/x/net and golang.org/x/text to patched versions (#4807)
The scheduled Trivy scan has been failing on master with two HIGH
findings, and it fails every pull request along with it:

- CVE-2026-56852, golang.org/x/text, denial of service, fixed in 0.39.0
- CVE-2026-46600, golang.org/x/net/dns/dnsmessage, denial of service,
  fixed in 0.56.0

Bump both to the first patched release. golang.org/x/crypto and
golang.org/x/sys move with them as transitive requirements of x/net.

Verified with the same settings the workflow uses:

  trivy fs --scanners vuln --severity CRITICAL,HIGH,MEDIUM \
    --ignore-unfixed --exit-code 1 .

which now exits 0. go build ./... and go test ./... pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-08-15 13:43:07 +08:00
dependabot[bot] 00cfe5aac2 chore(deps): bump the actions group across 1 directory with 4 updates (#4787)
Bumps the actions group with 4 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [actions/setup-go](https://github.com/actions/setup-go), [actions/cache](https://github.com/actions/cache) and [codecov/codecov-action](https://github.com/codecov/codecov-action).


Updates `actions/checkout` from 6 to 7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

Updates `actions/setup-go` from 6 to 7
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v6...v7)

Updates `actions/cache` from 5 to 6
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v5...v6)

Updates `codecov/codecov-action` from 6 to 7
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-go
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: codecov/codecov-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-15 13:42:11 +08:00
greymoth 34dac209ff docs: fix BindXML comment referencing nonexistent binding.BindXML (#4717)
The doc comment on line 790 read:
  "BindXML is a shortcut for c.MustBindWith(obj, binding.BindXML)."

`binding.BindXML` does not exist. The correct symbol is `binding.XML`
(defined in binding/binding.go), which is also what the implementation
uses. All sibling methods (BindJSON, BindYAML, BindTOML, etc.) already
reference the correct symbol in their comments.
2026-06-27 00:48:16 +08:00
Hershel1995andCarmelo Sottile 03f3e420a3 update validator library to version 10.30.3 (#4707)
Co-authored-by: Carmelo Sottile <carmelo.sottile@ericsson.com>
2026-06-23 20:08:30 +08:00
d9307dbcbb fix(context): skip chmod on pre-existing dirs in SaveUploadedFile (#4702)
* fix: skip chmod on pre-existing dirs in SaveUploadedFile

Fixes #4622

Prior to this change, SaveUploadedFile unconditionally called
os.Chmod(dir, mode) after os.MkdirAll, even when the target
directory already existed. This caused 'operation not permitted'
errors when saving files into system-owned directories like /tmp
that the current process does not own.

The fix uses os.Stat before MkdirAll to detect whether the
directory already exists, and only calls os.Chmod when the
directory was freshly created by MkdirAll.

This restores the behaviour from v1.10.1 where only os.MkdirAll
was used (which correctly skips permission changes on existing dirs)
while preserving the custom permission feature added in v1.12.0.

Regression test added: TestSaveUploadedFileToExistingDir saves
a file into os.TempDir() (a pre-existing system directory) and
asserts no error is returned.

* test: make SaveUploadedFile #4622 regression test platform-independent

The regression test relied on os.Chmod failing on a pre-existing directory,
which only happens for a non-owner, non-root process. When tests run as root
(common in containers/CI) or with a user-owned $TMPDIR, the buggy chmod
succeeds, so the test passed even against the unfixed code.

Assert the actual contract instead: a pre-existing directory's permissions
are left unchanged. This catches the regression deterministically on every
platform.

Also tighten the SaveUploadedFile doc/comments: the requested perm is enforced
only on the newly created destination directory, not on every directory in the
path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 23:34:41 +08:00
da1e108614 test(context): use t.TempDir() for SaveUploadedFile permission test on WSL (#4709)
* fix: change file creation to use c.Temp instead to work on wsl

* test(context): use t.TempDir() in SaveUploadedFile failure test for WSL

Mirror the WSL-portability fix applied to TestSaveUploadedFileWithPermission:
write under t.TempDir() instead of a relative path so the test does not depend
on the working directory's filesystem (drvfs reports 0o777 on WSL) and is
cleaned up automatically.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 22:43:44 +08:00
MuaazTasawarandBo-Yi Wu 074b669a95 test(response_writer): add tests for Flush() with and without http.Flusher (#4699)
* test(response_writer): add tests for Flush() with and without http.Flusher

* test(response_writer): drop stray comment and clarify Flush regression note

- Remove orphaned doc comment left at the end of the file
- Reword the issue #4460 reference to reflect the no-panic guard

---------

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-06-22 21:18:24 +08:00
4a3eb31fb1 fix(recovery): record recovered panics in c.Errors (#4698)
* fix: record recovered panic errors

* chore(deps): bump quic-go to v0.59.1

* refactor(recovery): simplify panic error recording

- Collapse the if/else into a single c.Error call in defaultHandleRecovery
- Assert the recorded panic error is ErrorTypePrivate in the test

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: m0_66095053 <2876430886@qq.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 20:56:28 +08:00
AmirhfandBo-Yi Wu 293ad7edeb fix(context): Copy() copies Errors and Accepted fields (#4695)
* Previously, Copy() only copied Keys and Params, leaving Errors and
Accepted as nil even when set on the original context. Goroutines
receiving a copied context could not observe errors attached before
the copy, and content-negotiation state set by middleware was silently
lost.

* Replace assert.Equal(t, len(c.Errors), len(cp.Errors)) with assert.Len(t, cp.Errors, 2) to satisfy the testifylint linter rule

---------

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-06-22 19:09:26 +08:00
Bo-Yi Wu 2e4d4f3896 chore(deps): bump github.com/quic-go/quic-go to v0.60.0 (#4713)
- Upgrade quic-go from v0.59.0 to v0.60.0
2026-06-22 19:00:06 +08:00
Sai Asish YandBo-Yi Wu d75fcd4c9a fix(response): panic on Hijack/CloseNotify when wrapper unsupported (#4645)
* response_writer: don't panic on Hijack/CloseNotify when wrapper unsupported

Closes #4638. http.TimeoutHandler's writer doesn't implement http.Hijacker/CloseNotifier; mirror Flush's graceful degradation.

* response_writer: keep Written() false when Hijack is unsupported

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>

---------

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-06-02 22:02:14 +08:00
Tero Saarni 8d0468f728 chore(deps): bump golang.org/x/net to v0.55.0 (#4678)
Signed-off-by: Tero Saarni <tero.saarni@est.tech>
2026-06-02 21:50:57 +08:00
Leehainuo 88c4263538 docs(context): align inline comments in GetPostForm example (#4675)
Standardize comment alignment in GetPostForm documentation example
to improve readability and maintain consistency with code formatting
conventions.
2026-06-02 21:49:36 +08:00
Raju Ahmed 96ece6a141 feat(context): add Scheme() with proper reverse proxy support (#4655)
* feat(context): add Scheme method to determine HTTP scheme from request

* test(context): add tests for Scheme method
2026-06-02 21:48:53 +08:00
wanghaolong613 c79f5d466e refactor: optimize error message concatenation in default_validator (#4685) 2026-06-02 21:45:58 +08:00
dependabot[bot] 5f4f964325 chore(deps): bump the actions group across 1 directory with 2 updates (#4640)
Bumps the actions group with 2 updates in the / directory: [codecov/codecov-action](https://github.com/codecov/codecov-action) and [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action).


Updates `codecov/codecov-action` from 5 to 6
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5...v6)

Updates `aquasecurity/trivy-action` from 0.35.0 to 0.36.0
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](https://github.com/aquasecurity/trivy-action/compare/0.35.0...v0.36.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: aquasecurity/trivy-action
  dependency-version: 0.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-09 10:20:32 +08:00
d3ffc99852 test(engine): add regression tests for HandleContext with NoRoute (#4571)
Add two regression tests for GitHub issue #1848 to verify that
Context.handlers are properly isolated in HandleContext when used
from a NoRoute handler with group and engine middleware.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-03-16 20:49:59 +08:00
Bo-Yi WuandClaude Opus 4.6 ecd26c8835 docs(readme): update benchmark results with latest data (#4583)
- Remove 20 deprecated frameworks from benchmark report
- Add BunRouter and Fiber as newly benchmarked routers
- Add ranked summary table based on GitHub API throughput
- Add memory consumption tables sorted by bytes ascending
- Include all micro and API benchmark results with rankings

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:16:42 +08:00
Bo-Yi WuandClaude Opus 4.6 a749e4d33c docs: replace AUTHORS.md with link to GitHub contributors page (#4582)
AUTHORS.md was a manually maintained list of 400+ contributors that
had no automation to keep it current. Replace it with a link to
GitHub s built-in contributors page which is always up-to-date.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 14:34:58 +08:00
Bo-Yi WuandClaude Opus 4.6 65d1c470ec docs(benchmarks): update benchmark report with Gin v1.12.0 results (#4581)
- Update test environment to Apple M4 Pro, Go 1.25.8, macOS
- Add table of contents for easier navigation
- Add ranked summary tables for each API benchmark
- Reorganize full results by API section with clear headings
- Refresh all memory consumption and benchmark data

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 14:17:04 +08:00
tsingluaandBo-Yi Wu 6d880724cc refactor(test): use the built-in max/min to simplify the code (#4576)
Signed-off-by: tsinglua <tsinglua@outlook.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-03-13 22:42:00 +08:00
Bo-Yi WuandClaude Opus 4.6 48667a2dd1 chore(deps): upgrade Go dependencies and CI action versions (#4580)
- Bump golangci-lint from v2.9 to v2.11
- Bump aquasecurity/trivy-action from 0.34.2 to 0.35.0
- Upgrade golang.org/x packages (net, crypto, sys, text, arch)
- Upgrade go-json, mimetype, and protobuf to latest patch versions

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 22:40:18 +08:00
Bo-Yi WuandClaude Opus 4.6 d4672219fc docs: reorganize doc.md TOC into thematic groups (#4579)
The flat TOC under a single "API Examples" heading made it hard to scan
and find relevant content. Reorganize 40+ sections into 7 logical groups
(Routing, Middleware, Logging, Request Binding & Validation, Response
Rendering, Server Configuration, Testing) with description lines for
each group. Move scattered sections into their correct groups and fix
the "avoid-loging-query-strings" anchor typo.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 22:30:54 +08:00
dependabot[bot] 3e44fdc4d1 chore(deps): bump aquasecurity/trivy-action in the actions group (#4557)
Bumps the actions group with 1 update: [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action).


Updates `aquasecurity/trivy-action` from 0.34.1 to 0.34.2
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](https://github.com/aquasecurity/trivy-action/compare/0.34.1...0.34.2)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-version: 0.34.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-04 14:10:36 +08:00
HolynnChenandBo-Yi Wu cb2b764cc8 test(make): modify test folder and test command in Makefile (#4465)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-02-28 21:55:28 +08:00
Max KatzandBo-Yi Wu a39670fb7b docs(license): update license period (#4130)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-02-28 21:46:37 +08:00
Aum Patel 052d1a79aa feat(render): add PDF renderer and tests (#4491)
* render: add PDF renderer and tests

* render: update PDF renderer copyright header

* test: add PDF rendering tests including 204 No Content in context_test.go
2026-02-28 21:04:54 +08:00
Bo-Yi Wu ff00c01e67 docs: revise and expand Gin 1.12.0 release announcement (#4554)
- Update release announcement section to introduce Gin 1.12.0
- Provide a more detailed description of new features and improvements in version 1.12.0

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2026-02-28 20:38:49 +08:00
Bo-Yi Wu 73726dc606 docs: update documentation to reflect Go version changes (#4552)
- Remove the changelog entry about bumping minimum Go version to 1.24 and updating workflows

Signed-off-by: appleboy <appleboy.tw@gmail.com>
v1.12.0
2026-02-28 18:10:09 +08:00
Bo-Yi WuandCopilot e292e5caa7 docs: document and finalize Gin v1.12.0 release (#4551)
* docs: document and finalize Gin v1.12.0 release

- Add changelog entries for the Gin v1.12.0 release, covering new features, enhancements, bug fixes, build updates, and dependency upgrades
- Update all historical changelog entries to consistently use the same bullet style
- Bump Gin version constant to v1.12.0
- Update README to announce Gin 1.12.0 instead of 1.11.0

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

* Update CHANGELOG.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-28 18:07:46 +08:00
Bo-Yi Wu ae3f524974 ci: update Go version support to 1.25+ across CI and docs (#4550)
* ci: update Go version support to 1.25+ across CI and docs

- Remove Go 1.24 from CI test matrix to only support 1.25 and 1.26
- Update documentation to require Go version 1.25 or above

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

* chore: increase required Go version for Gin to 1.25

- Update minimum required Go version for Gin from 1.24 to 1.25
- Revise related warning message and test expectations to match new version requirement

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

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2026-02-28 17:37:02 +08:00
dependabot[bot]andBo-Yi Wu 38534e2bf9 chore(deps): bump golang.org/x/net from 0.50.0 to 0.51.0 (#4548)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.50.0 to 0.51.0.
- [Commits](https://github.com/golang/net/commits)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.51.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-02-28 16:18:12 +08:00
Varun ChawlaandBo-Yi Wu 472d086af2 fix(tree): panic in findCaseInsensitivePathRec with RedirectFixedPath (#4535)
* fix(tree): panic in findCaseInsensitivePathRec with RedirectFixedPath enabled

When RedirectFixedPath is enabled and a request doesn't match any route,
findCaseInsensitivePathRec panics with "invalid node type". This happens
because it accesses children[0] to find the wildcard child, but addChild()
keeps the wildcard child at the end of the array (not the beginning).

When a node has both static and wildcard children, children[0] is a static
node, so the switch on nType falls through to the default panic case.

The fix mirrors what getValue() already does correctly (line 483):
use children[len(children)-1] to access the wildcard child.

Fixes #2959

* Address review feedback: improve test assertions and prefer static routes in case-insensitive lookup

- Assert found=false for non-matching paths instead of only checking for panics
- Fix expected casing for case-insensitive static route match (/PREFIX/XXX -> /prefix/xxx)
- Update findCaseInsensitivePathRec to try static children before falling back to
  wildcard child, ensuring static routes win over param routes in case-insensitive matching

---------

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-02-28 11:15:27 +08:00