Skip to content

Commit

Permalink
Fix error message about content-types (#775)
Browse files Browse the repository at this point in the history
The error message had a copy+pasta bug where it was showing the wrong
prefix. This resulted in possibly very confusing error message where it
complained that the content-type was wrong, but then said it was
expecting exactly what it actually got.
  • Loading branch information
jhump authored Sep 13, 2024
1 parent 2a694ed commit 99d6b9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions duplex_http_call.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ func (d *duplexHTTPCall) CloseWrite() error {
// response to read from.
if d.requestSent.CompareAndSwap(false, true) {
go d.makeRequest()
// We never setup a request body, so it's effectively already closed.
// So nothing else to do.
return nil
}
// The user calls CloseWrite to indicate that they're done sending data. It's
Expand Down
2 changes: 1 addition & 1 deletion protocol_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ func connectValidateStreamResponseContentType(requestCodecName string, streamTyp
CodeUnknown,
"invalid content-type: %q; expecting %q",
responseContentType,
connectUnaryContentTypePrefix+requestCodecName,
connectStreamingContentTypePrefix+requestCodecName,
)
}
responseCodecName := connectCodecFromContentType(
Expand Down

0 comments on commit 99d6b9c

Please sign in to comment.