Skip to content

Commit 5c58198

Browse files
committed
avoid trim
no check null need it.
1 parent 123a712 commit 5c58198

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/ContentCompressionAsyncExec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public AsyncDataConsumer handleResponse(final HttpResponse rsp,
141141
final HeaderElement[] el = BasicHeaderValueParser.INSTANCE
142142
.parseElements(coding, new ParserCursor(0, coding.length()));
143143
for (int i = el.length - 1; i >= 0; i--) {
144-
final String token = el[i].getName().trim().toLowerCase(Locale.ROOT);
144+
final String token = el[i].getName().toLowerCase(Locale.ROOT);
145145
if ("identity".equals(token) || token.isEmpty()) {
146146
continue;
147147
}
@@ -186,7 +186,7 @@ public long getContentLength() {
186186

187187
@Override
188188
public String getContentType() {
189-
return original != null ? original.getContentType() : null;
189+
return original.getContentType();
190190
}
191191

192192
@Override

0 commit comments

Comments
 (0)