checkMethods method

Future<Message> checkMethods(
  1. Request request
)

Implementation

Future<Message> checkMethods(Request request) async {
  if (blockedMethods.contains(request.method!)) {
    //TODO: Detail
    throw Exception("${request.method} Not Allowed");
  } else if (allowedMethods.isNotEmpty &&
      !allowedMethods.contains(request.method)) {
    throw Exception("${request.method} Not Allowed");
  }
  return request;
}