You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In certain cases, when the backend legitimately returns a 204 No Content from is call (for example, when uploading to S3), the front end fails to see that as a success due to the following code in ajax.js
This attempts to perform a response.json() on the response with no body.
While this can be fixed with the fetchResponseInterceptor as follows, it is messy and it would be cleaner to simply handle this in the ajax.js code with a conditional as follows:
The much more complex version with the fetchResponseInterceptor
fetchResponseInterceptor: asyncfunctionfetchResponseInterceptor(originalResponse){if(originalResponse.status===204||originalResponse.status===304){// Create a new valid Response with no bodyconstresponseWithNoBody=newResponse(null,{status: originalResponse.status,statusText: originalResponse.statusText,headers: originalResponse.headers,});// Patch `.json()` to return an empty object when calledresponseWithNoBody.json=()=>Promise.resolve({});returnresponseWithNoBody;// Return the patched response}// For non-204/304, return the original response as isreturnoriginalResponse;},
It would be nice to handle the 204 gracefully in the vuefinder code vs. the application...
The text was updated successfully, but these errors were encountered:
In certain cases, when the backend legitimately returns a 204 No Content from is call (for example, when uploading to S3), the front end fails to see that as a success due to the following code in ajax.js
This attempts to perform a response.json() on the response with no body.
While this can be fixed with the fetchResponseInterceptor as follows, it is messy and it would be cleaner to simply handle this in the ajax.js code with a conditional as follows:
The much more complex version with the fetchResponseInterceptor
It would be nice to handle the 204 gracefully in the vuefinder code vs. the application...
The text was updated successfully, but these errors were encountered: