internal/etag
import "github.com/gofiber/fiber/v3/internal/etag"
Package etag parses and compares HTTP entity tags (RFC 9110 Section 8.8.3). It is shared by the core conditional-request path (Ctx.Fresh) and the ETag middleware, which previously carried divergent parsers: the middleware split If-None-Match on every comma, mis-parsing an opaque-tag that contains one.
Functions
func AnyMatch(header, etag string) bool
Source: internal/etag/etag.go:78
AnyMatch reports whether any entity tag in the raw If-None-Match field value matches etag. Comparison is weak as defined by RFC 9110 Section 8.8.3.2, and "*" matches every entity tag. An empty field value matches nothing.
func Match(s, etag string) bool
Source: internal/etag/etag.go:35
Match performs a weak comparison of entity tags according to RFC 9110 Section 8.8.3.2. The weak indicator ("W/") is ignored, but both tags must be properly quoted. Invalid tags result in a mismatch.
func MatchStrong(s, etag string) bool
Source: internal/etag/etag.go:48
MatchStrong performs a strong entity-tag comparison following RFC 9110 Section 8.8.3.1. A weak tag never matches a strong one, even if the quoted values are identical.
func Parse(t string) (value string, weak, ok bool)
Source: internal/etag/etag.go:20
Parse validates an entity tag and returns the value without quotes. weak is true if the tag has the "W/" prefix.
func Split(header string) []string
Source: internal/etag/etag.go:61
Split returns the entity tags in a raw If-None-Match or If-Match field value. A comma inside a quoted opaque-tag does not separate it (RFC 9110 Section 8.8.3), and empty list elements are skipped. Returns nil for no tags.