Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public class HttpRequest {
private static String getValidCharset(final String charset) {
if (charset != null && charset.length() > 0)
return charset;
else

return CHARSET_UTF8;
}

Expand Down Expand Up @@ -649,7 +649,8 @@ public static byte[] encodeBytesToBytes(byte[] source, int off, int len) {
byte[] finalOut = new byte[e];
System.arraycopy(outBuff, 0, finalOut, 0, e);
return finalOut;
} else
}

return outBuff;
}
}
Expand Down Expand Up @@ -1744,7 +1745,7 @@ protected ByteArrayOutputStream byteStream() {
final int size = contentLength();
if (size > 0)
return new ByteArrayOutputStream(size);
else

return new ByteArrayOutputStream();
}

Expand Down Expand Up @@ -2194,7 +2195,7 @@ public String[] headers(final String name) {
final List<String> values = headers.get(name);
if (values != null && !values.isEmpty())
return values.toArray(new String[values.size()]);
else

return EMPTY_STRINGS;
}

Expand Down Expand Up @@ -2538,7 +2539,8 @@ public HttpRequest contentType(final String contentType, final String charset) {
if (charset != null && charset.length() > 0) {
final String separator = "; " + PARAM_CHARSET + '=';
return header(HEADER_CONTENT_TYPE, contentType + separator + charset);
} else
}

return header(HEADER_CONTENT_TYPE, contentType);
}

Expand Down