FineUploader / server-examples

Server-side examples for the Fine Uploader library

Home Page:https://fineuploader.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

response content syntax error at line 63

maitlandrm opened this issue · comments

https://github.com/FineUploader/server-examples/blob/master/python/django-fine-uploader-s3/views.py#L63

the response content above should be '{"invalid": True}'

As it is now, the xhrOrXdr.responseText will fall into the except clause because it's just an object and jQuery can't parse it as JSON. In fact, "invalid" will be the only thing that makes it into the responseText at all.

Here's the beginning of the try/except: https://github.com/FineUploader/fine-uploader/blob/c1b4954f21381dbd664e379abf571c988e2265c0/client/js/uploadsuccess.ajax.requester.js#L42

Thanks for catching this. jQuery is not involved here as Fine Uploader does not use it.

I'm not able to test any changes to the python examples at this time. Have you personally run into this issue? If so, please do open a pull request so I can merge in the fix.

Whatever you return from your server must be valid JSON - based on what you have written, the issue you are having is indeed caused by an invalid response.

huh, I thought that’s what qq.parseJSON() was in their handleSuccessResponse function

That's Fine Uploader code.

I can fork the repo and make the change sometime this weekend, if you want me to.

That would be excellent. Thanks!