Skip to content

Middleware register issue. #442

@AdriaanBoshoff

Description

@AdriaanBoshoff

I'm having an issue where the middlware is running only for the POST endpoints and not running in the order its being declared.

  • POST /v1/login - Should not have middleware but it does.
  • GET /v1/getproducts - Should not have middleware and it doesn't
  • GET /v1/test - Should have middlware but it doesn't
procedure TAPIEndpointsV1.RegisterEndpoints;
begin
  FController := THorse.Group.Prefix('/v1'); // REGISTER GROUP

  FController.Post('/login', Self.POST_Login); // Middleware runs but it shouldnt

  FController.Get('/getproducts', Self.GET_Products); // Middleware doesnt run

  FController.Use(Self.MW_ValidateSession); // Register Middleware

  FController.Get('/test', Self.GET_Test); // Middleware doesnt run but it should
end;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions