diff --git a/web/service/base.ts b/web/service/base.ts index fb32ce6bcf..956886bea9 100644 --- a/web/service/base.ts +++ b/web/service/base.ts @@ -396,7 +396,9 @@ export const upload = async (options: UploadOptions, isPublicAPI?: boolean, url? xhr.responseType = 'json' xhr.onreadystatechange = function () { if (xhr.readyState === 4) { - if (xhr.status === 201) + // Accept any 2xx status code per HTTP semantics + // POST returns 201 Created, PUT returns 200 OK + if (xhr.status >= 200 && xhr.status < 300) resolve(xhr.response) else reject(xhr)