Skip to content

Commit 4882721

Browse files
authored
📒docs: Fix EarlyData middleware docs (#3646)
1 parent 0f2ffc5 commit 4882721

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/middleware/earlydata.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ Safe HTTP methods — `GET`, `HEAD`, `OPTIONS` and `TRACE` — should not modify
2121

2222
```go
2323
func New(config ...Config) fiber.Handler
24-
func IsEarlyData(c fiber.Ctx) bool
24+
func IsEarly(c fiber.Ctx) bool
2525
```
2626

27+
`IsEarly` returns `true` when a request used early data and the middleware allowed it to proceed.
28+
2729
## Examples
2830

2931
Import the middleware package that is part of the Fiber web framework

middleware/earlydata/earlydata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const (
1212
localsKeyAllowed contextKey = 0 // earlydata_allowed
1313
)
1414

15-
// IsEarly returns true if the request is an early-data request
15+
// IsEarly returns true if the request used early data and was accepted by the middleware.
1616
func IsEarly(c fiber.Ctx) bool {
1717
return c.Locals(localsKeyAllowed) != nil
1818
}

0 commit comments

Comments
 (0)