*: revendor, update proto files

This commit is contained in:
Gyu-Ho Lee
2016-11-10 11:53:48 -08:00
parent baa4e4ee56
commit b8b72f80f9
418 changed files with 212090 additions and 3386 deletions

View File

@ -15,8 +15,12 @@ import (
"google.golang.org/grpc/metadata"
)
const metadataHeaderPrefix = "Grpc-Metadata-"
const metadataTrailerPrefix = "Grpc-Trailer-"
// MetadataHeaderPrefix is prepended to HTTP headers in order to convert them to
// gRPC metadata for incoming requests processed by grpc-gateway
const MetadataHeaderPrefix = "Grpc-Metadata-"
// MetadataTrailerPrefix is prepended to gRPC metadata as it is converted to
// HTTP headers in a response handled by grpc-gateway
const MetadataTrailerPrefix = "Grpc-Trailer-"
const metadataGrpcTimeout = "Grpc-Timeout"
const xForwardedFor = "X-Forwarded-For"
@ -52,8 +56,8 @@ func AnnotateContext(ctx context.Context, req *http.Request) (context.Context, e
pairs = append(pairs, "authorization", val)
continue
}
if strings.HasPrefix(key, metadataHeaderPrefix) {
pairs = append(pairs, key[len(metadataHeaderPrefix):], val)
if strings.HasPrefix(key, MetadataHeaderPrefix) {
pairs = append(pairs, key[len(MetadataHeaderPrefix):], val)
}
}
}