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

allow customizing how files are downloaded, not just the headers. #53

Closed
wants to merge 1 commit into from

Conversation

hpoul
Copy link
Contributor

@hpoul hpoul commented Nov 1, 2018

A small change to allow clients to customize download behavior, instead of using the defaul http.get() method.

My specific use case is that I have a NTLM Authentication, but can't just push in the (cookie) headers, because 1.) I want to catch the case when my session expires and I need to reauthenticate with the server. and 2.) I fetch images from different servers, which have different sessions but the same authentication.

Is this something you'd consider merging? I would also patch https://github.com/renefloor/flutter_cached_network_image to allow the same customization.

@The-Redhat
Copy link

Nice work. I also really need this for a project. 👍

@krwrang
Copy link

krwrang commented Nov 9, 2018

This would simplify my code too, as currently I have to check my tokens first for refreshing needs before I can let CachedNetworkImage do its thing.

@lifenautjoe
Copy link

Hi @renefloor , this would be great! Please take al look 🙏

@renefloor
Copy link
Contributor

@hpoul I was working on a complete redesign of the library and the API, so that's why I didn't merge this pull request. I did use your idea in the new design though, so thanks for the pull request anyway. The new design should be much more flexible in the long run.
See this commit: renefloor@f3d71e2

I will publish a new alpha or beta build soon.

@renefloor renefloor closed this Nov 24, 2018
@lifenautjoe
Copy link

lifenautjoe commented Nov 24, 2018 via email

@renefloor
Copy link
Contributor

@lifenautjoe see version 0.3.0-alpha.2. The readme of that release already gives a good direction on how to implement it.

@hpoul
Copy link
Contributor Author

hpoul commented Nov 24, 2018

@renefloor thanks, i have since abstracted even more, because i migrated from http library to dio - would this be something worth looking at too? see AustrianApps@7cca69d

@renefloor
Copy link
Contributor

@hpoul could be interesting, do you already have a use case for it?

@hpoul
Copy link
Contributor Author

hpoul commented Nov 25, 2018

@renefloor yep, I have migrated away from the http package in favor of dio: https://github.com/flutterchina/dio/ - mostly because the default http library does not support multi value headers and I didn't want to patch it because it was such a hotly debated topic that i doubt it would ever get merged ( dart-lang/sdk#21802 ) - and dio seems pretty good (at least API wise) and I've implemented NTLM authenticated based on dio interceptors.

@renefloor
Copy link
Contributor

@hpoul I just implemented your suggestion, will release this soon: renefloor@ea7ff1f

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.

5 participants