Hardcoded form data in uploader
I’m testing Quasar’s v0.14 uploader together with kinto-attachment (an attachment plugin for Kinto storage) and there is a problem.
The problem sits with both Quasar and Kinto:
- in the uploader, there is a line:
form.append('Content-Type', file.type || 'application/octet-stream')
The form is then sent with xhr.send(form). There is no insertion point where that form can be further customized (so that I can remove the unwanted Content-Type field.
- in kinto (irelevant for this) there will be an error when not all form fields are processable.
I’ll address this problem to the Kinto maintainers, also, but there it may have bigger implications and that code be aligned with some package philosophy. Here, in Quasar, at least, maybe it’s possible to somehow register a “modifier” for the form, before it’s submitted? Or make the Content-Type field optional?
This post is deleted!
Hi, unfortunately no time to assess the situation now. Focusing on bringing v0.14 out there. Can we resume talks after v0.14 or is it too late?
Sorry, no worries, I was able to patch things on the Kinto side, using an event subscriber. I’ll add a ticket as a reminder. Anyway, it’'s just an edge case, where Kinto-attachment expects that submited forms only have “valid” fields, from its point of view, but quasar adds that field without an opportunity to tweak that.
Will see what I can do about that.
Hi, did you ever create a ticket on this? I am running into the same issue with the hard coded ‘Content-Type’ field.
If not, I’ll create an issue for it.