Internal

internal/byterange

import "github.com/gofiber/fiber/v3/internal/byterange"

Package byterange adds the Range and If-Range rules (RFC 9110 §13.1.5, §14.2) that fasthttp's file server lacks: it takes only a lower-case "bytes" unit, applies Range to HEAD and matches If-Range by date alone. It is shared by Ctx.SendFile and the static middleware.

Functions

func Wrap(handler fasthttp.RequestHandler) fasthttp.RequestHandler

Source: internal/byterange/byterange.go:92

Wrap returns handler, a fasthttp file server with byte ranges enabled, with the Range field handled as RFC 9110 asks. The field is ignored, and the whole file sent, for a non-GET request, a unit other than "bytes", several ranges, or an If-Range that does not match the response's ETag (when the caller set one) or its Last-Modified.