Skip to content

Commit 4355f67

Browse files
committed
fixup
1 parent 6d6e3fa commit 4355f67

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/api/api-fetch.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)