refa
This commit is contained in:
parent
374b7084a7
commit
62dab4fa3d
|
@ -2,6 +2,7 @@ package org.bench4q.master.scriptrecord.httpcapture.generator;
|
|||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.master.exception.ExceptionLog;
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public class ResponseHeader {
|
|||
}
|
||||
|
||||
boolean isHtmlContent() {
|
||||
return getContentType().toLowerCase().compareTo("text/html") == 0;
|
||||
return getContentType().toLowerCase().contains("text/html");
|
||||
}
|
||||
|
||||
boolean isGoodRequest() {
|
||||
|
|
|
@ -40,7 +40,8 @@ public class ResponseParser {
|
|||
public ResponseParser(byte[] response) {
|
||||
this.setResponse(response);
|
||||
this.setResponseHeader(parseResponseHeader());
|
||||
if (this.getResponseHeader().isValidResponseHeader()) {
|
||||
if (this.getResponseHeader().isValidResponseHeader()
|
||||
&& this.getResponseHeader().isHtmlContent()) {
|
||||
this.parseResponseBody();
|
||||
}
|
||||
}
|
||||
|
@ -150,6 +151,9 @@ public class ResponseParser {
|
|||
this.getResponse().length
|
||||
- this.getResponseHeader().getContentLength(),
|
||||
this.getResponseHeader().getContentLength()));
|
||||
if (contentBodyAfterDecoded == null) {
|
||||
return;
|
||||
}
|
||||
Charset charset = null;
|
||||
try {
|
||||
charset = Charset.forName(this.getResponseHeader().getCharset());
|
||||
|
|
Loading…
Reference in New Issue