mirror of https://github.com/grpc/grpc-node.git
Update server to handle default schemes
This commit is contained in:
parent
0b522b2289
commit
b6846f0709
|
@ -45,7 +45,7 @@ import {
|
|||
} from './server-call';
|
||||
import { ServerCredentials } from './server-credentials';
|
||||
import { ChannelOptions } from './channel-options';
|
||||
import { createResolver, ResolverListener } from './resolver';
|
||||
import { createResolver, ResolverListener, mapUriDefaultScheme } from './resolver';
|
||||
import { log } from './logging';
|
||||
import {
|
||||
SubchannelAddress,
|
||||
|
@ -226,10 +226,14 @@ export class Server {
|
|||
throw new TypeError('callback must be a function');
|
||||
}
|
||||
|
||||
const portUri = parseUri(port);
|
||||
if (portUri === null) {
|
||||
const initialPortUri = parseUri(port);
|
||||
if (initialPortUri === null) {
|
||||
throw new Error(`Could not parse port "${port}"`);
|
||||
}
|
||||
const portUri = mapUriDefaultScheme(initialPortUri);
|
||||
if (portUri === null) {
|
||||
throw new Error(`Could not get a default scheme for port "${port}"`);
|
||||
}
|
||||
|
||||
const serverOptions: http2.ServerOptions = {};
|
||||
if ('grpc.max_concurrent_streams' in this.options) {
|
||||
|
|
Loading…
Reference in New Issue