Skip to content
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

Remove file URL error, add support for downloads #3342

Merged
merged 2 commits into from Oct 25, 2020

Conversation

jshier
Copy link
Contributor

@jshier jshier commented Oct 25, 2020

Issue Link πŸ”—

#3332

Goals ⚽

Turns out some people do use local file URLs for testing and such, so this PR removes the previous error and fixes DownloadRequest to properly support downloaded files.

Implementation Details 🚧

The only code changes are in DownloadRequest since it previously required an HTTPURLResponse to generate the file location on disk. Unfortunately URLSessionDownloadTask doesn't treat a file URL download in any special way, so it just copies the file to the temp directory. Alamofire then moves that file to a new name so it survives the URLSession cleanup.

Testing Details πŸ”

Previously added tests have been updated to now succeed with file URLs.

@jshier jshier merged commit bcbc769 into master Oct 25, 2020
@jshier jshier deleted the feature/file-url-support branch October 25, 2020 23:48
@jshier jshier added this to the 5.4.0 milestone Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant