mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #14958 from overleaf/em-fetch-json-real-empty-bodies
fetchJSON: only send a body when explicitly asked GitOrigin-RevId: 08b05ad0822a11671ce5bb2522c1ce534ad19c82
This commit is contained in:
parent
43570cb7b4
commit
27bdf9fb0b
1 changed files with 2 additions and 2 deletions
|
@ -103,7 +103,7 @@ export class FetchError extends OError {
|
|||
function fetchJSON<T>(
|
||||
path: FetchPath,
|
||||
{
|
||||
body = {},
|
||||
body,
|
||||
headers = {},
|
||||
method = 'GET',
|
||||
credentials = 'same-origin',
|
||||
|
@ -123,7 +123,7 @@ function fetchJSON<T>(
|
|||
method,
|
||||
}
|
||||
|
||||
if (method !== 'GET' && method !== 'HEAD') {
|
||||
if (body !== undefined) {
|
||||
options.body = JSON.stringify(body)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue