-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content Type Option #30
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #30 +/- ##
==========================================
- Coverage 65.92% 65.38% -0.54%
==========================================
Files 1 1
Lines 179 182 +3
==========================================
+ Hits 118 119 +1
- Misses 41 42 +1
- Partials 20 21 +1
Continue to review full report at Codecov.
|
bridge.go
Outdated
@@ -298,6 +298,7 @@ type CallOpts struct { | |||
QueryPassthrough bool `json:"queryPassthrough"` | |||
Body string `json:"body"` | |||
ExpectedCode int `json:"expectedCode"` | |||
ContentType string `json:"ContentType"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs formatting
bridge.go
Outdated
@@ -341,7 +342,12 @@ func (h *Helper) HTTPCallRawWithOptsWithContext(ctx context.Context, method, url | |||
if err != nil { | |||
return nil, err | |||
} | |||
req.Header.Add("Content-Type", "application/json") | |||
|
|||
if (opts.ContentType == "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trivial change, but personally prefer len(opts.ContentType) > 0
in Go, as it looks a bit cleaner rather than literal string matching.
No description provided.