Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. Handler middleware(Handler innerHandler) {
  2.  
  3. return (Request req) async {
  4. if(req.method == "GET" && req.headers["xxx"] == yyy) {
  5. // Handle the request
  6. ...
  7. }
  8. else {
  9. // This gives exception:
  10. // Bad state: The 'read' method can only be called once on a shelf.Request/shelf.Response object.
  11. return innerHandler(req);
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement