dart-lang / shelf

Web server middleware for Dart
https://pub.dev/packages/shelf
BSD 3-Clause "New" or "Revised" License
893 stars 125 forks source link

Documentation Clarification - `createMiddleware` and `context` #411

Open jtmcdole opened 5 months ago

jtmcdole commented 5 months ago

Request and Response are immutable and so is the context member. The documentation for context makes it seem easy to signal information to middleware and handlers.

  1. Update context to be clear that modifying it on a request or response requires calling .change() on those objects
  2. Adding a note in createMiddleware about the inability to forward a new request/response

Happy to work on this. Would also be happy to have a way to easily pass information down a pipeline without manipulating the request object.

kevmoo commented 5 months ago

Go for it!