From eb3bd654cdb8cff60e126b739fc06961d24d233a Mon Sep 17 00:00:00 2001 From: David Symonds Date: Thu, 24 Sep 2015 18:12:31 +1000 Subject: [PATCH] Switch from github.com/bradfitz/http2 to golang.org/x/net/http2. The latter is now the official HTTP2 package for Go. --- transport/control.go | 2 +- transport/http2_client.go | 4 ++-- transport/http2_server.go | 4 ++-- transport/http_util.go | 12 ++++++------ transport/transport_test.go | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/transport/control.go b/transport/control.go index 464bf10a..6b5201e7 100644 --- a/transport/control.go +++ b/transport/control.go @@ -37,7 +37,7 @@ import ( "fmt" "sync" - "github.com/bradfitz/http2" + "golang.org/x/net/http2" ) const ( diff --git a/transport/http2_client.go b/transport/http2_client.go index 40b76408..526f5115 100644 --- a/transport/http2_client.go +++ b/transport/http2_client.go @@ -43,9 +43,9 @@ import ( "sync" "time" - "github.com/bradfitz/http2" - "github.com/bradfitz/http2/hpack" "golang.org/x/net/context" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" diff --git a/transport/http2_server.go b/transport/http2_server.go index 8856d7f4..057d9368 100644 --- a/transport/http2_server.go +++ b/transport/http2_server.go @@ -42,9 +42,9 @@ import ( "strconv" "sync" - "github.com/bradfitz/http2" - "github.com/bradfitz/http2/hpack" "golang.org/x/net/context" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" diff --git a/transport/http_util.go b/transport/http_util.go index e8ed39e1..c41892d0 100644 --- a/transport/http_util.go +++ b/transport/http_util.go @@ -43,8 +43,8 @@ import ( "sync/atomic" "time" - "github.com/bradfitz/http2" - "github.com/bradfitz/http2/hpack" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/metadata" @@ -143,10 +143,10 @@ func newHPACKDecoder() *hpackDecoder { case "content-type": // TODO(zhaoq): Tentatively disable the check until a bug is fixed. /* - if !strings.Contains(f.Value, "application/grpc") { - d.err = StreamErrorf(codes.FailedPrecondition, "transport: received the unexpected header") - return - } + if !strings.Contains(f.Value, "application/grpc") { + d.err = StreamErrorf(codes.FailedPrecondition, "transport: received the unexpected header") + return + } */ case "grpc-status": code, err := strconv.Atoi(f.Value) diff --git a/transport/transport_test.go b/transport/transport_test.go index ad512884..07ba0051 100644 --- a/transport/transport_test.go +++ b/transport/transport_test.go @@ -44,8 +44,8 @@ import ( "testing" "time" - "github.com/bradfitz/http2" "golang.org/x/net/context" + "golang.org/x/net/http2" "google.golang.org/grpc/codes" )