Skip to content

Commit 7d42f31

Browse files
committed
switch binary response handler content type filter to a regex for more flexibility
1 parent c8cfff9 commit 7d42f31

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/com/loopj/android/http/BinaryHttpResponseHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package com.loopj.android.http;
2020

2121
import java.io.IOException;
22+
import java.util.regex.Pattern;
2223

2324
import org.apache.http.Header;
2425
import org.apache.http.HttpEntity;
@@ -168,7 +169,7 @@ void sendResponseMessage(HttpResponse response) {
168169
Header contentTypeHeader = contentTypeHeaders[0];
169170
boolean foundAllowedContentType = false;
170171
for(String anAllowedContentType : mAllowedContentTypes) {
171-
if(anAllowedContentType.equals(contentTypeHeader.getValue())) {
172+
if(Pattern.matches(anAllowedContentType, contentTypeHeader.getValue())) {
172173
foundAllowedContentType = true;
173174
}
174175
}

0 commit comments

Comments
 (0)