Problem
In v0.2.0, writeResults copies headers from the service's *github.Response, then unconditionally replaces Content-Type with application/json for JSON bodies.
That contradicts the documented behavior that a returned response can set explicit headers and prevents a GitHub-compatible implementation from returning application/json; charset=utf-8.
Reproduction
Return a value plus:
&github.Response{Response: &http.Response{
StatusCode: http.StatusCreated,
Header: http.Header{
"Content-Type": {"application/json; charset=utf-8"},
},
}}
A real go-github client observes Content-Type: application/json.
Requested behavior
Set application/json only when no Content-Type has already been supplied. Add a real go-github round-trip test proving an explicit Content-Type survives.
Problem
In v0.2.0,
writeResultscopies headers from the service's*github.Response, then unconditionally replacesContent-Typewithapplication/jsonfor JSON bodies.That contradicts the documented behavior that a returned response can set explicit headers and prevents a GitHub-compatible implementation from returning
application/json; charset=utf-8.Reproduction
Return a value plus:
A real go-github client observes
Content-Type: application/json.Requested behavior
Set
application/jsononly when no Content-Type has already been supplied. Add a real go-github round-trip test proving an explicit Content-Type survives.