(rctx *fasthttp.RequestCtx)
| 452 | } |
| 453 | |
| 454 | func (app *App) customRequestHandler(rctx *fasthttp.RequestCtx) { |
| 455 | ctx := app.AcquireCtx(rctx) |
| 456 | defer app.ReleaseCtx(ctx) |
| 457 | |
| 458 | // Check if the HTTP method is valid |
| 459 | if ctx.getMethodInt() == -1 { |
| 460 | _ = ctx.SendStatus(StatusNotImplemented) //nolint:errcheck // Always return nil |
| 461 | return |
| 462 | } |
| 463 | |
| 464 | // Optional: check flash messages (hot path, see hasFlashCookie). |
| 465 | if hasFlashCookie(&ctx.Request().Header) { |
| 466 | ctx.Redirect().parseAndClearFlashMessages() |
| 467 | } |
| 468 | |
| 469 | _, err := app.nextCustom(ctx) |
| 470 | if err != nil { |
| 471 | if catch := ctx.App().ErrorHandler(ctx, err); catch != nil { |
| 472 | _ = ctx.SendStatus(StatusInternalServerError) //nolint:errcheck // Always return nil |
| 473 | } |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | func (app *App) addPrefixToRoute(prefix string, route *Route, regexHandler any, customConstraints ...CustomConstraint) *Route { |
| 478 | prefixedPath := getGroupPath(prefix, route.Path) |
no test coverage detected