Skip to content

Commit

Permalink
Fix X-Request-ID header generation for golang client
Browse files Browse the repository at this point in the history
  • Loading branch information
sas1024 committed Sep 21, 2022
1 parent f9e91fe commit 86635c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions golang/go_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ func (rc *rpcClient) Exec(ctx context.Context, rpcReq zenrpc.Request) (*zenrpc.R
req.Header = rc.header.Clone()
req.Header.Add("Content-Type", "application/json")
if xRequestID := ctx.Value("X-Request-ID"); xRequestID.(string) != "" {
req.Header.Add("X-Request-ID",xRequestID.(string))
if xRequestID, ok := ctx.Value("X-Request-ID").(string); ok && xRequestID != "" {
req.Header.Add("X-Request-ID", xRequestID)
}
// Do request
Expand Down
4 changes: 2 additions & 2 deletions golang/testdata/catalogue_client.go

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

0 comments on commit 86635c6

Please sign in to comment.