diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-03-03 18:01:54 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-03-03 18:01:54 -0800 |
commit | 246e354775354329a6c4544d3f31be0f054c640b (patch) | |
tree | ebc5b3dc5940607c3277f144ccda7cad210c6dcb /src/github/daneren2005 | |
parent | 50f81f657f9c2c520f4af08a519f0c1d73a2b9a1 (diff) | |
download | dsub-246e354775354329a6c4544d3f31be0f054c640b.tar.gz dsub-246e354775354329a6c4544d3f31be0f054c640b.tar.bz2 dsub-246e354775354329a6c4544d3f31be0f054c640b.zip |
Fix html errors not being recognized as errors
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/service/RESTMusicService.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/service/RESTMusicService.java b/src/github/daneren2005/dsub/service/RESTMusicService.java index 341b1158..69c0b236 100644 --- a/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -699,7 +699,7 @@ public class RESTMusicService implements MusicService { // If content type is XML, an error occured. Get it. String contentType = Util.getContentType(entity); - if (contentType != null && contentType.startsWith("text/xml")) { + if (contentType != null && (contentType.startsWith("text/xml") || contentType.startsWith("text/html"))) { new ErrorParser(context, getInstance(context)).parse(new InputStreamReader(in, Constants.UTF_8)); return null; // Never reached. } @@ -777,7 +777,7 @@ public class RESTMusicService implements MusicService { // If content type is XML, an error occurred. Get it. String contentType = Util.getContentType(response.getEntity()); - if (contentType != null && contentType.startsWith("text/xml")) { + if (contentType != null && (contentType.startsWith("text/xml") || contentType.startsWith("text/html"))) { InputStream in = response.getEntity().getContent(); Header contentEncoding = response.getEntity().getContentEncoding(); if (contentEncoding != null && contentEncoding.getValue().equalsIgnoreCase("gzip")) { @@ -1437,8 +1437,7 @@ public class RESTMusicService implements MusicService { // If content type is XML, an error occurred. Get it. String contentType = Util.getContentType(entity); - if (contentType != null && contentType.startsWith("text/xml")) - { + if (contentType != null && (contentType.startsWith("text/xml") || contentType.startsWith("text/html"))) { new ErrorParser(context, getInstance(context)).parse(new InputStreamReader(in, Constants.UTF_8)); return null; // Never reached. } @@ -1498,7 +1497,7 @@ public class RESTMusicService implements MusicService { // If content type is XML, an error occurred. Get it. String contentType = Util.getContentType(entity); - if (contentType != null && contentType.startsWith("text/xml")) { + if (contentType != null && (contentType.startsWith("text/xml") || contentType.startsWith("text/html"))) { new ErrorParser(context, getInstance(context)).parse(new InputStreamReader(in, Constants.UTF_8)); return null; // Never reached. } |