Merge pull request #324 from iamqizhao/master

Omit port number when construting audience string if it is default on…
This commit is contained in:
Qi Zhao 2015-08-31 19:00:50 -07:00
commit 868330046b
1 changed files with 5 additions and 2 deletions

View File

@ -244,10 +244,13 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea
}
authData := make(map[string]string)
for _, c := range t.authCreds {
// Generate the audience string.
// Construct URI required to get auth request metadata.
var port string
if pos := strings.LastIndex(t.target, ":"); pos != -1 {
port = ":" + t.target[pos+1:]
// Omit port if it is the default one.
if t.target[pos+1:] != "443" {
port = ":" + t.target[pos+1:]
}
}
pos := strings.LastIndex(callHdr.Method, "/")
if pos == -1 {