Fix middleware to use HTTP methods from req handler for OPTIONS queries