Skip to content

Commit

Permalink
Fix UI upload failed with error connot convert undefined or null to o…
Browse files Browse the repository at this point in the history
…bject (#6818)
  • Loading branch information
nopcoder authored Oct 19, 2023
1 parent d589981 commit e710e53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion webui/src/lib/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,9 @@ export const uploadWithProgress = (url, file, method = 'POST', onProgress = null
xhr.open(method, url, true);
xhr.setRequestHeader('Accept', 'application/json');
xhr.setRequestHeader('X-Lakefs-Client', 'lakefs-webui/__buildVersion');
Object.keys(additionalHeaders).map(key => xhr.setRequestHeader(key, additionalHeaders[key]))
if (additionalHeaders) {
Object.keys(additionalHeaders).map(key => xhr.setRequestHeader(key, additionalHeaders[key]))
}
if (url.startsWith(API_ENDPOINT)) {
// swagger API requires a form with a "content" field
const data = new FormData();
Expand Down

0 comments on commit e710e53

Please sign in to comment.