Skip to content

Commit ae86754

Browse files
committed
github: rename bodyType to mime
1 parent a4f8f2e commit ae86754

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

github/github.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ var VERBOSITY = 0
2323
//
2424
// TODO: This function is amazingly ugly (separate headers, token, no API
2525
// URL constructions, et cetera).
26-
func DoAuthRequest(method, url, bodyType, token string, headers map[string]string, body io.Reader) (*http.Response, error) {
27-
req, err := newAuthRequest(method, url, bodyType, token, headers, body)
26+
func DoAuthRequest(method, url, mime, token string, headers map[string]string, body io.Reader) (*http.Response, error) {
27+
req, err := newAuthRequest(method, url, mime, token, headers, body)
2828
if err != nil {
2929
return nil, err
3030
}
@@ -219,8 +219,8 @@ func (c Client) getPaginated(uri string) (io.ReadCloser, error) {
219219
}
220220

221221
// Create a new request that sends the auth token.
222-
func newAuthRequest(method, url, bodyType, token string, headers map[string]string, body io.Reader) (*http.Request, error) {
223-
vprintln("creating request:", method, url, bodyType, token)
222+
func newAuthRequest(method, url, mime, token string, headers map[string]string, body io.Reader) (*http.Request, error) {
223+
vprintln("creating request:", method, url, mime, token)
224224

225225
var n int64 // content length
226226
var err error
@@ -245,8 +245,8 @@ func newAuthRequest(method, url, bodyType, token string, headers map[string]stri
245245
req.ContentLength = n
246246
}
247247

248-
if bodyType != "" {
249-
req.Header.Set("Content-Type", bodyType)
248+
if mime != "" {
249+
req.Header.Set("Content-Type", mime)
250250
}
251251
req.Header.Set("Authorization", "token "+token)
252252

0 commit comments

Comments
 (0)