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