-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'NoneType' object has no attribute 'file' #100
Comments
I'll add a safety check but I couldn't reproduce when investigating #82 (which is likely to be the same) |
The 500 is fixed with current master. However, when running the integration tests of Kinto/kinto-http.js#115, I get a 400 because the client does not send the proper |
Makes sense, but now I wonder how it could ever work in the kinto-admin? We definitely don't set this header there. |
Also, if I force the content-type header like this: diff --git a/src/collection.js b/src/collection.js
index a0ee33c..6ce3f86 100644
--- a/src/collection.js
+++ b/src/collection.js
@@ -193,6 +193,10 @@ export default class Collection {
const addAttachmentRequest = {
...updateRequest,
method: "POST",
+ headers: {
+ ...updateRequest.headers,
+ "Content-Type": "multipart/form-data",
+ },
body: formData
};
return this.client.execute(addAttachmentRequest, {stringify: false}); I'm getting a new server error (using latest kinto-attachment master):
|
kinto-attachment 0.7.1, messing around with the API from js, managed to crash the server with some rotten request:
I unfortunately can't provide a curl/httpie command for reproducing as fetch doesn't expose such a feature.
The text was updated successfully, but these errors were encountered: