mirror of https://github.com/grpc/grpc-dart.git
Provide scheme as part of audience (#211)
This commit is contained in:
parent
6d485375ba
commit
9d2a469655
|
@ -1,3 +1,7 @@
|
|||
## 2.0.2
|
||||
|
||||
* Fix computation of the audience given to metadata providers to include the scheme.
|
||||
|
||||
## 2.0.1
|
||||
|
||||
* Fix computation of authority. This should fix authorization.
|
||||
|
|
|
@ -150,7 +150,7 @@ class ClientCall<Q, R> implements Response {
|
|||
Future.forEach(
|
||||
options.metadataProviders,
|
||||
(provider) => provider(
|
||||
metadata, "${connection.authority}${audiencePath(_method)}"))
|
||||
metadata, '${connection.scheme}://${connection.authority}${audiencePath(_method)}'))
|
||||
.then((_) => _sendRequest(connection, _sanitizeMetadata(metadata)))
|
||||
.catchError(_onMetadataProviderError);
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ enum ConnectionState {
|
|||
|
||||
abstract class ClientConnection {
|
||||
String get authority;
|
||||
String get scheme;
|
||||
|
||||
/// Put [call] on the queue to be dispatched when the connection is ready.
|
||||
void dispatchCall(ClientCall call);
|
||||
|
|
|
@ -65,6 +65,8 @@ class Http2ClientConnection implements connection.ClientConnection {
|
|||
String get authority =>
|
||||
options.credentials.authority ?? (port == 443 ? host : "$host:$port");
|
||||
|
||||
String get scheme => options.credentials.isSecure ? 'https' : 'http';
|
||||
|
||||
ConnectionState get state => _state;
|
||||
|
||||
Future<ClientTransportConnection> connectTransport() async {
|
||||
|
|
|
@ -143,6 +143,7 @@ class XhrClientConnection extends ClientConnection {
|
|||
XhrClientConnection(this.uri);
|
||||
|
||||
String get authority => uri.authority;
|
||||
String get scheme => uri.scheme;
|
||||
|
||||
void _initializeRequest(HttpRequest request, Map<String, String> metadata) {
|
||||
for (final header in metadata.keys) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
name: grpc
|
||||
description: Dart implementation of gRPC, a high performance, open-source universal RPC framework.
|
||||
|
||||
version: 2.0.1
|
||||
version: 2.0.2
|
||||
|
||||
author: Dart Team <misc@dartlang.org>
|
||||
homepage: https://github.com/dart-lang/grpc-dart
|
||||
|
|
Loading…
Reference in New Issue