File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ var url = require('url')
1010
1111function 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 ) {
You can’t perform that action at this time.
0 commit comments