mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-12 07:30:46 +02: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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user