Alamofire: problem on 5.3 version when call request with localfile url

Created on 21 Oct 2020  路  7Comments  路  Source: Alamofire/Alamofire

on previous version 5.2.2 , i will get local json file with
let fileUrl = Bundle.main.url(forResource:fileName, withExtension: type)

this is result for url " file:///private/var/containers/Bundle/Application/1ADSDXS-E4F0-45FD-9866-
5AB24ACCDBA7/MYAPP.app/TutorialImage.json "

after update version to 5.3 it return invalid url

needs investigation

Most helpful comment

Alright, I can see that. A full fix will be more involved since it needs to work for all types of requests. I'll see if I can revert with a proper fix soon.

All 7 comments

Yes, this was turned into an error due to issues with DownloadRequest. What's your use case here? Why use Alamofire for this when you can just load the file directly?

Just found this also.

I use it to debug/test because it is convenient, meaning that if I wish to switch from remote json to my local test json I can simply change the remote url to file url and everything else (serializing etc.) stays the same. Sure I can put my test json file on some server and use that but that is not as convenient as editing json file in xcode and just hitting run, also cannot do that while offline.

Alright, I can see that. A full fix will be more involved since it needs to work for all types of requests. I'll see if I can revert with a proper fix soon.

Thank:]

The error has been removed in 5.4.0.

Upload file Progress closer is not called.

Fix for this issue shipped with Alamofire 5.4.0.

Was this page helpful?
0 / 5 - 0 ratings