Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Handler middleware(Handler innerHandler) {
- return (Request req) async {
- if(req.method == "GET" && req.headers["xxx"] == yyy) {
- // Handle the request
- ...
- }
- else {
- // This gives exception:
- // Bad state: The 'read' method can only be called once on a shelf.Request/shelf.Response object.
- return innerHandler(req);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement