Moderator: moderators
Index: subsonic-android/src/net/sourceforge/subsonic/androidapp/service/RESTMusicService.java
===================================================================
--- subsonic-android/src/net/sourceforge/subsonic/androidapp/service/RESTMusicService.java (revision 2981)
+++ subsonic-android/src/net/sourceforge/subsonic/androidapp/service/RESTMusicService.java (working copy)
@@ -731,7 +731,10 @@
private void detectRedirect(String originalUrl, Context context, HttpContext httpContext) {
HttpUriRequest request = (HttpUriRequest) httpContext.getAttribute(ExecutionContext.HTTP_REQUEST);
HttpHost host = (HttpHost) httpContext.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
- String redirectedUrl = host.toURI() + request.getURI();
+ String redirectedUrl = request.getURI().toString();
+ if (request.getURI() != null && !request.getURI().toString().contains(host.toURI())) {
+ redirectedUrl = host.toURI() + request.getURI();
+ }
redirectFrom = originalUrl.substring(0, originalUrl.indexOf("/rest/"));
redirectTo = redirectedUrl.substring(0, redirectedUrl.indexOf("/rest/"));
Users browsing this forum: No registered users and 37 guests