dependabot[bot]andGitHub f74cffbbb4 build(deps): bump the golang-modules group across 1 directory with 4 updates
Bumps the golang-modules group with 4 updates in the / directory: [golang.org/x/crypto](https://github.com/golang/crypto), [golang.org/x/net](https://github.com/golang/net), [golang.org/x/sys](https://github.com/golang/sys) and [golang.org/x/text](https://github.com/golang/text).


Updates `golang.org/x/crypto` from 0.50.0 to 0.57.0
- [Commits](https://github.com/golang/crypto/compare/v0.50.0...v0.57.0)

Updates `golang.org/x/net` from 0.53.0 to 0.58.0
- [Commits](https://github.com/golang/net/compare/v0.53.0...v0.58.0)

Updates `golang.org/x/sys` from 0.43.0 to 0.48.0
- [Commits](https://github.com/golang/sys/compare/v0.43.0...v0.48.0)

Updates `golang.org/x/text` from 0.36.0 to 0.42.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.36.0...v0.42.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.57.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-modules
- dependency-name: golang.org/x/net
  dependency-version: 0.58.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-modules
- dependency-name: golang.org/x/sys
  dependency-version: 0.48.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: golang-modules
- dependency-name: golang.org/x/text
  dependency-version: 0.42.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-modules
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-09-24 19:24:49 +00:00
2026-09-24 10:13:17 -07:00
2026-09-17 13:15:05 -07:00
2026-02-03 00:41:36 -05:00
2026-01-25 00:05:15 -05:00
2026-02-09 00:38:26 -05:00
2026-03-21 14:44:39 -04:00
2021-06-23 06:28:46 +02:00
2025-11-10 07:59:16 -05:00
2026-01-25 15:04:53 -05:00
2026-02-07 20:06:26 +01:00
2026-04-23 19:19:20 -04:00
2026-02-03 09:23:58 -05:00
2026-02-03 09:23:58 -05:00

fiber

Docs: fiber · part of the ZAP Protocol

A fork of gofiber/fiber v3 that adds one thing: specificity-based route precedence, natively in the router. The most specific pattern wins regardless of registration order — ServeMux-1.22 semantics. Everything else is upstream Fiber v3, unchanged.

Drop-in replacement for gofiber v3.2.0. Module path github.com/zap-proto/fiber/v3. zip is its intended consumer.

go get github.com/zap-proto/fiber/v3

Why fork

Upstream Fiber matches routes in registration order — the first route on the per-method stack that matches wins. That makes precedence depend on when a route was registered rather than how specific it is, so a wildcard registered first silently shadows a static sibling:

app.Get("/v1/iam/*",    listAll)   // registered first — matches everything
app.Get("/v1/iam/keys", getKeys)   // registered second — never reached

Precedence should be a property of the pattern, not of registration order. This fork moves that rule into the router — the one place that already owns matching — so services never hand-order routes.

What changes

The fork keeps Fiber's stack model but maintains each per-method stack in most-specific-first order via sorted insertion. Fiber's tree buckets preserve the stack's relative order and the matcher returns the first match in a bucket, so ordering the stack by specificity makes the most specific pattern win for every registration order — with no changes to the matcher or the tree builder.

The comparator mirrors Go 1.22 net/http.ServeMux:

  • static literal ≻ :param ≻ */+ wildcard; more static structure wins; a deeper static route beats a shallower wildcard; the longer literal breaks a static tie.
  • Ambiguous overlap panics at registration. Two distinct patterns of equal specificity (e.g. /x/:id vs /x/:name) have no winner — the fork panics loudly, naming both, exactly as ServeMux rejects two patterns when neither is more specific.
  • Exemptions, so it stays drop-in: the same pattern re-registered keeps Fiber's handler merge (both run); different methods are independent; and constraint-typed params (:id<int> vs :slug) match disjoint value sets, so they are not a conflict and keep registration order.
  • Middleware keeps declaration order. use and mounted sub-apps are precedence barriers; endpoints sort only within the run between barriers, so middleware always wraps the handlers declared after it. Routes added at runtime land in the correct position after RebuildTree.
// Registration order no longer matters — the static route always wins.
app.Get("/v1/iam/*",    listAll)
app.Get("/v1/iam/keys", getKeys)
// GET /v1/iam/keys          -> getKeys
// GET /v1/iam/anything-else -> listAll

The change lives in router_precedence.go; the contract is pinned by router_precedence_test.go.

Compatibility

Same package name (fiber), same public API, same fiber.Ctx / fiber.Handler / fiber.Config / middleware packages as gofiber v3.2.0. Swap the import path from github.com/gofiber/fiber/v3 to github.com/zap-proto/fiber/v3. Released on semver tags tracking upstream (fork tagged v3.2.1).

The only behavior differences are the intended ones: correct precedence in place of registration-order shadowing, and a loud startup panic for genuinely ambiguous unconstrained patterns.

Full rationale and the comparator: zap-proto.dev/docs/fiber.

License & attribution

MIT. This is a fork of gofiber/fiber — the upstream license is carried forward unchanged:

Copyright © 2019-present Fenny and Contributors

See LICENSE. All upstream credit belongs to the Fiber maintainers and contributors; this fork adds only the router-precedence layer described above.

S
Description
Fork of gofiber/fiber v3 — adds specificity-based route precedence (ServeMux-1.22 semantics) natively in the router
Readme MIT
66 MiB
Languages
Go 99.9%