File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -333,6 +333,12 @@ function fetch (opts) {
333333 opts . redirect = 'follow'
334334 }
335335
336+ if ( opts . method != null ) {
337+ opts . method = normalizeAndValidateRequestMethod ( opts . method )
338+ } else {
339+ opts . method = 'GET'
340+ }
341+
336342 if ( opts . integrity ) {
337343 // TODO: Implement
338344 throw new NotSupportedError ( )
@@ -361,7 +367,7 @@ function fetch (opts) {
361367 return new Promise ( ( resolve , reject ) => this . dispatch ( {
362368 path : opts . path ,
363369 origin : opts . origin ,
364- method : normalizeAndValidateRequestMethod ( opts . method || 'GET' ) ,
370+ method : opts . method ,
365371 body,
366372 headers : headers ? ( headers [ kHeadersList ] || headers ) : null ,
367373 maxRedirections : opts . redirect === 'follow' ? 20 : 0 // https://fetch.spec.whatwg.org/#concept-http-redirect-fetch
You can’t perform that action at this time.
0 commit comments