Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Migrate to null safety #50

Merged
merged 3 commits into from
May 11, 2021
Merged

Migrate to null safety #50

merged 3 commits into from
May 11, 2021

Conversation

grouma
Copy link
Contributor

@grouma grouma commented May 10, 2021

@grouma grouma requested a review from kenzieschmoll May 10, 2021 22:52
@grouma
Copy link
Contributor Author

grouma commented May 10, 2021

Towards flutter/devtools#2978

@grouma grouma requested a review from jacob314 May 10, 2021 23:08
@@ -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'

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?

Copy link
Contributor Author

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.

@@ -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)!,

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link

@kenzieschmoll kenzieschmoll left a 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

@grouma grouma merged commit adc3ac8 into master May 11, 2021
@kevmoo kevmoo deleted the migrate branch January 25, 2023 03:04
mosuem pushed a commit to dart-lang/tools that referenced this pull request Dec 10, 2024
* Support null safety

* update api

* review cleanup
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Migrate library to be null safe
2 participants