-
Notifications
You must be signed in to change notification settings - Fork 2k
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
XHR plugin expects upload response to be a valid JSON #5349
Comments
Do you think this is the same issue I have |
Nope, to me this does not look like the same issue. |
Hi, what do you want to return that is not JSON? We made it required because Uppy (ideally) needs to know where the resource that was just uploaded is located. If you return XML, you could use |
My particular service returns plain text with id of the uploaded file and I have no intention to change the response only to make Uppy happy. With 3.x it works just fine because there is the |
I can make a change to allow |
As I understand, upload location URL is needed for Golden Retriever, that makes sense ... |
I will log a better error but |
I'm new here and was not aware of problems users or devs run into with previous hooks. I started with 3.x version and was happy to see 4.x with improved typescript support, but the problem with XHR uploader forced me to stay on 3.x at least for now. From my point of view, requirement to return a document in a specific format is very strict limitation, and makes the XHR uploader very specific, whereas it is supposed to be a general purpose uploader. Users may not want or may not have an ability to adjust response format of their upload endpoints. |
Initial checklist
Link to runnable example
No response
Steps to reproduce
XHR plugin in Uppy 4.0 seem to require the file upload endpoint to return a valid JSON. There is a code that attempts to extract upload URL from the response:
If the response is not a JSON document, then upload fails.
Expected behavior
It is expected that this behavior is configurable or the code has proper error handling.
Actual behavior
File upload fails. I figured out that
responseType
option not used. This might be a regression introduced after migrating tofetcher
use.The text was updated successfully, but these errors were encountered: