Comments (13)
We do follow redirects but the problem here is that the redirect is from http to https. Here is a StackOverflow post (and Java bug) about this http://stackoverflow.com/a/1884427/253583.
If you change the original url to use https it works for example. Do you think we should manually handle redirects from http to https anyways?
from webimageloader.
I'm trying to use redirects (from HTTP to HTTP) and they're not working, and I can't see in the code anywhere where redirects are considered. I get the same stacktrace above, and I can see that no second network is being sent.
I call HttpURLConnection.setFollowRedirects(true);
before attempting to load any images.
The only slightly different thing is that the server I'm using is returning HTTP 307 redirects (rather than the more oft-used 301 or 302).
What have I missed? :)
from webimageloader.
The answer seems to be the HTTP 307 status code.
http://b.android.com/41739 indicates that the 307 status code isn't properly handled.
I tested this library with the Twitter API URL above (though went from HTTPS to HTTPS) and it worked great.
from webimageloader.
The library relies on HttpUrlConnection to handle redirects (which it does by default).
I don't think this it's possible to work around this issue as-is, however I could modify ConnectionHandler to allow for returning a new UrlConnection so you could work around this. Do you want this?
from webimageloader.
Yeah, that sounds good.
I've been thinking about integrating OkHttp anyway, since it fixes some other Android HTTP bugs that I need to deal with. So this would probably work out.
from webimageloader.
I wonder if it would be better to actually change the signature to take an URL so your free to use OkHttp if you want instead of having to just throw a connection away? It would still only be called for http(s) though.
from webimageloader.
Sounds like a good idea to me!
from webimageloader.
is this issue fixed in latest maven build?
from webimageloader.
@mecid Which issue specifically? Redirects already work fine with this library; 307 redirects don't work, but that's an Android bug (which I solved by using pull request #17 and OkHttp).
from webimageloader.
@orrc this your pull request included in latest maven build?
from webimageloader.
@mecid No, the pull request is open; there hasn't been any discussion about it so far. I compiled my own JAR from source.
from webimageloader.
It's not merged yet, in the meantime you can clone @orrc repo and compile it yourself.
from webimageloader.
I am using okhttp from your sample, but redirects not working.
from webimageloader.
Related Issues (20)
- Use HttpResponseCache (or similar) instead of reimplementing HTTP caching HOT 4
- Document the internal of webimageloader
- Pause async loader on scroll HOT 2
- Packages and Eclipse HOT 1
- Bypass Cache HOT 5
- Disk Cache not cacheing last image HOT 2
- LruCache and recycle bitmaps HOT 1
- Not possible to request images over HTTPS HOT 2
- Not working with new version of DiskLRUChache HOT 1
- Generate new version using DiskLRU 2.0.0 HOT 4
- Allow to post xml with the request
- Flag to ignore cache and force reload HOT 4
- Image from disk cache is without transparent background HOT 3
- Not able to load certain URLs
- Some images are always loaded from the network
- APIs for thread management
- Custom header attributes for request HOT 3
- Create load function which retrieves the path to the file instead of a Bitmap HOT 3
- Create a class which inherits from AsyncTask for progress updates HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webimageloader.