Skip to content

Commit 6d99316

Browse files
committed
if we get a not valid charset, send the request with the default charset encoding.
1 parent 38dc3c2 commit 6d99316

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

cSploit/src/main/java/org/csploit/android/net/http/proxy/StreamThread.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.io.IOException;
2828
import java.io.InputStream;
2929
import java.io.OutputStream;
30+
import java.io.UnsupportedEncodingException;
3031

3132
public class StreamThread implements Runnable
3233
{
@@ -168,7 +169,13 @@ public void run(){
168169
}
169170

170171
if (charset != null) {
171-
mBuffer.setData((headers + HEAD_SEPARATOR + body).getBytes(charset));
172+
try {
173+
mBuffer.setData((headers + HEAD_SEPARATOR + body).getBytes(charset));
174+
}
175+
catch (UnsupportedEncodingException e){
176+
Logger.error("UnsupportedEncoding: " + e.getLocalizedMessage());
177+
mBuffer.setData((headers + HEAD_SEPARATOR + body).getBytes());
178+
}
172179
}
173180
else {
174181
// if we haven't found the charset encoding, just handle it on ByteBuffer()

0 commit comments

Comments
 (0)