Skip to content

Commit

Permalink
Update grpc-web dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbrandhorst committed Feb 10, 2018
1 parent fe0e4a9 commit 16ac2b4
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ required = [
name = "github.com/golang/protobuf"

[[constraint]]
branch = "master"
name = "github.com/improbable-eng/grpc-web"
version = "0.5.0"

[[constraint]]
branch = "master"
Expand Down
1 change: 1 addition & 0 deletions grpcweb/grpcwebjs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
package-lock.json
4 changes: 2 additions & 2 deletions grpcweb/grpcwebjs/grpc.inc.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions grpcweb/invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ func invoke(
request := js.Global.Get("grpc").Call("invoke", methodDesc, props)

cancelFunc := func() {
// https://github.com/improbable-eng/grpc-web/blob/0ab7201b53447db59d63ff3a95173e565baae10a/ts/src/grpc.ts#L310
request.Call("abort")
// https://github.com/improbable-eng/grpc-web/blob/eb398c2f9233171176ceebb2353148224a0e58a0/ts/src/invoke.ts#L50
request.Call("close")
}

return cancelFunc, nil
Expand Down
10 changes: 5 additions & 5 deletions grpcweb/metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ import (
// Metadata encasulates the Improbable Metadata.
type Metadata struct {
*js.Object
MD metadata.MD `js:"keyValueMap"`
MD metadata.MD `js:"headersMap"`
}

// New initializes and populates a new Metadata.
func New(md metadata.MD) *Metadata {
b := &Metadata{
Object: js.Global.Get("Metadata").New(),
m := &Metadata{
Object: js.Global.Get("grpc").Get("Metadata").New(),
}
b.MD = md
return b
m.MD = md
return m
}
3 changes: 2 additions & 1 deletion test/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func main() {
Handler: http.HandlerFunc(emptyHandler),
}

grpclog.Printf("Starting servers.")
grpclog.Printf("Starting servers")

// Start the empty Http1.1 server
go func() {
Expand Down Expand Up @@ -109,6 +109,7 @@ func main() {
Addr: shared.GopherJSServer,
Handler: http.FileServer(http.Dir("./client/html")),
}
grpclog.Printf("Serving tests on https://localhost:8080")
if err := httpsSrv.ListenAndServeTLS("./insecure/localhost.crt", "./insecure/localhost.key"); err != nil {
grpclog.Fatalf("failed to start JS server: %v", err)
}
Expand Down
14 changes: 8 additions & 6 deletions vendor/github.com/improbable-eng/grpc-web/go/grpcweb/wrapper.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 16ac2b4

Please sign in to comment.