-
Notifications
You must be signed in to change notification settings - Fork 127
Shelf 1.1.1 breaking change: request body runtime type changed from Stream<List<int>> to Stream<Uint8List> #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yeah, very unintentional. Before we were ALWAYS wrapping the input in The question now: do we revert and give up the perf win? This is a ~duplicate of #188 – leaving open to discuss |
Whether or not you choose to release the |
Hi, as raised in #193 I am trying to find the best way now to receive a large file upload. Is there a recommended example? |
Just got to put the converter first: diff --git a/example/mime.dart b/example/mime.dart
index 1975ead..a5735a9 100644
--- a/example/mime.dart
+++ b/example/mime.dart
@@ -6,7 +6,7 @@ import 'package:shelf/shelf_io.dart' as shelf_io;
Future<void> main() async {
var server = await shelf_io.serve(
(request) async {
- await request.read().transform(gzip.decoder).drain();
+ await gzip.decoder.bind(request.read()).drain();
return shelf.Response.ok('');
},
'localhost', |
this bug has been fixed? |
I doubt we're going to fix it at this point... |
Shelf 1.1.1 introduced a breaking change. By changing the runtime type of request bodies from
Stream<List<int>>
toStream<Uint8List>
, it caused it to no longer work with instances ofStreamTransformer<List<int>, List<int>>
such asdart:io
'sgzip.encoder
andgzip.decoder
. This is a breaking change and, if it was necessary, should have been released with a major version bump.The following code works with shelf 1.1.0 and not with 1.1.1:
The text was updated successfully, but these errors were encountered: