Using address: 'localhost' didn't work as expected in the Docker
environment, so reverting to old behavior.

Fixed a typo.
This commit is contained in:
Jakob Andersen 2018-04-06 11:35:11 +02:00 committed by GitHub
parent 38ad37e2ef
commit 88485bad11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 10 deletions

View File

@ -136,7 +136,6 @@ Future<Null> main(List<String> args) async {
tlsCredentials = new ServerTlsCredentials( tlsCredentials = new ServerTlsCredentials(
certificate: await certificate, privateKey: await privateKey); certificate: await certificate, privateKey: await privateKey);
} }
await server.serve( await server.serve(port: port, security: tlsCredentials);
address: 'localhost', port: port, security: tlsCredentials);
print('Server listening on port ${server.port}...'); print('Server listening on port ${server.port}...');
} }

View File

@ -246,26 +246,26 @@ class ServerHandler extends ServiceCall {
void sendTrailers({int status = 0, String message}) { void sendTrailers({int status = 0, String message}) {
_timeoutTimer?.cancel(); _timeoutTimer?.cancel();
final outogingTrailersMap = <String, String>{}; final outgoingTrailersMap = <String, String>{};
if (!_headersSent) { if (!_headersSent) {
// TODO(jakobr): Should come from package:http2? // TODO(jakobr): Should come from package:http2?
outogingTrailersMap[':status'] = '200'; outgoingTrailersMap[':status'] = '200';
outogingTrailersMap['content-type'] = 'application/grpc'; outgoingTrailersMap['content-type'] = 'application/grpc';
_customHeaders..remove(':status')..remove('content-type'); _customHeaders..remove(':status')..remove('content-type');
outogingTrailersMap.addAll(_customHeaders); outgoingTrailersMap.addAll(_customHeaders);
_customHeaders = null; _customHeaders = null;
} }
_customTrailers..remove(':status')..remove('content-type'); _customTrailers..remove(':status')..remove('content-type');
outogingTrailersMap.addAll(_customTrailers); outgoingTrailersMap.addAll(_customTrailers);
_customTrailers = null; _customTrailers = null;
outogingTrailersMap['grpc-status'] = status.toString(); outgoingTrailersMap['grpc-status'] = status.toString();
if (message != null) { if (message != null) {
outogingTrailersMap['grpc-message'] = message; outgoingTrailersMap['grpc-message'] = message;
} }
final outgoingTrailers = <Header>[]; final outgoingTrailers = <Header>[];
outogingTrailersMap.forEach( outgoingTrailersMap.forEach(
(key, value) => outgoingTrailers.add(new Header.ascii(key, value))); (key, value) => outgoingTrailers.add(new Header.ascii(key, value)));
_stream.sendHeaders(outgoingTrailers, endStream: true); _stream.sendHeaders(outgoingTrailers, endStream: true);
// We're done! // We're done!