Skip to content

Commit

Permalink
jhttp: Accept invalid version markers in the bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Sep 9, 2021
1 parent ef57725 commit 5053abf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jhttp/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ func (b Bridge) serveInternal(w http.ResponseWriter, req *http.Request) error {
// The HTTP request requires a response, but the server will not reply if
// all the requests are notifications. Check whether we have any calls
// needing a response, and choose whether to wait for a reply based on that.
//
// Note that we are forgiving about a missing version marker in a request,
// since we can't tell at this point whether the server is willing to accept
// messages like that.
jreq, err := jrpc2.ParseRequests(body)
if err != nil {
if err != nil && err != jrpc2.ErrInvalidVersion {
return err
}
var hasCall bool
Expand Down

0 comments on commit 5053abf

Please sign in to comment.