You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/03/30 21:46:10 UTC

[airavata-django-portal] branch develop updated: Fix using PUT for file upload (FormData request)

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git


The following commit(s) were added to refs/heads/develop by this push:
     new a5f49f0  Fix using PUT for file upload (FormData request)
a5f49f0 is described below

commit a5f49f0c29fe62a2b94d7b209f6f8aed2b89e53c
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue Mar 30 17:45:55 2021 -0400

    Fix using PUT for file upload (FormData request)
---
 .../apps/api/static/django_airavata_api/js/utils/FetchUtils.js        | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/django_airavata/apps/api/static/django_airavata_api/js/utils/FetchUtils.js b/django_airavata/apps/api/static/django_airavata_api/js/utils/FetchUtils.js
index 480edfd..0d2544c 100644
--- a/django_airavata/apps/api/static/django_airavata_api/js/utils/FetchUtils.js
+++ b/django_airavata/apps/api/static/django_airavata_api/js/utils/FetchUtils.js
@@ -109,6 +109,10 @@ export default {
     } = {}
   ) {
     var headers = this.createHeaders(mediaType);
+    // Browsers automatically handle content type for FormData request bodies
+    if (body instanceof FormData) {
+      headers.delete("Content-Type");
+    }
     return this.processFetch(url, {
       method: "put",
       body: