Skip to content

Commit 56c10dc

Browse files
committed
style
1 parent f3f8bc0 commit 56c10dc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ var url = require('url')
1010

1111
function simpleGet (opts, cb) {
1212
opts = typeof opts === 'string' ? {url: opts} : Object.assign({}, opts)
13-
opts.headers = Object.assign({}, opts.headers)
1413
cb = once(cb)
1514

15+
opts.headers = Object.assign({}, opts.headers)
16+
1617
if (opts.url) parseOptsUrl(opts)
1718
if (opts.maxRedirects == null) opts.maxRedirects = 10
19+
if (opts.method) opts.method = opts.method.toUpperCase()
1820

1921
var body
2022
if (opts.form) body = typeof opts.form === 'string' ? opts.form : querystring.stringify(opts.form)
@@ -28,7 +30,6 @@ function simpleGet (opts, cb) {
2830
delete opts.form
2931

3032
if (body && !opts.method) opts.method = 'POST'
31-
if (opts.method) opts.method = opts.method.toUpperCase()
3233

3334
// Request gzip/deflate
3435
var customAcceptEncoding = Object.keys(opts.headers).some(function (h) {

0 commit comments

Comments
 (0)