-
Notifications
You must be signed in to change notification settings - Fork 26
Migrate to null safety #50
Conversation
Towards flutter/devtools#2978 |
@@ -13,7 +13,7 @@ import 'package:shelf/shelf.dart' as shelf; | |||
import 'package:stream_channel/stream_channel.dart'; | |||
|
|||
// RFC 2616 requires carriage return delimiters. | |||
String _sseHeaders(String origin) => 'HTTP/1.1 200 OK\r\n' | |||
String _sseHeaders(String? origin) => 'HTTP/1.1 200 OK\r\n' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If origin is null, would "Access-Control-Allow-Origin: null\r\n" would cause problems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't matter but I updated the logic so that it isn't included.
lib/src/server/sse_handler.dart
Outdated
@@ -273,11 +273,11 @@ class SseHandler { | |||
} | |||
return shelf.Response.ok('', headers: { | |||
'access-control-allow-credentials': 'true', | |||
'access-control-allow-origin': _originFor(req), | |||
'access-control-allow-origin': _originFor(req)!, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if _originFor
returns a String?
, should we be force unwrapping it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple questions, but generally lgtm
* Support null safety * update api * review cleanup
Closes dart-lang/tools#1645