Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Content Type Option #30

wants to merge 2 commits into from

Conversation

BkChoy
Copy link

@BkChoy BkChoy commented Jul 13, 2020

No description provided.

@codecov
Copy link

codecov bot commented Jul 13, 2020

Codecov Report

Merging #30 into master will decrease coverage by 0.53%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
bridge.go 65.38% <50.00%> (-0.54%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa6f132...ddb21f7. Read the comment docs.

@BkChoy BkChoy requested a review from jleeh July 13, 2020 21:29
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"`
Copy link
Contributor

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 == "") {
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants