From 8e652caa75b62dcf25ce832493ee0e463afeb685 Mon Sep 17 00:00:00 2001 From: monkeyWie Date: Fri, 9 Mar 2018 10:39:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DIE=E4=B9=B1=E7=A0=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lee/study/down/intercept/common/ResponseTextIntercept.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sniff/src/main/java/lee/study/down/intercept/common/ResponseTextIntercept.java b/sniff/src/main/java/lee/study/down/intercept/common/ResponseTextIntercept.java index ed751fde..2f0ebda8 100644 --- a/sniff/src/main/java/lee/study/down/intercept/common/ResponseTextIntercept.java +++ b/sniff/src/main/java/lee/study/down/intercept/common/ResponseTextIntercept.java @@ -86,7 +86,8 @@ public void afterResponse(Channel clientChannel, Channel proxyChannel, HttpConte protected boolean isHtml(HttpResponse httpResponse, HttpProxyInterceptPipeline pipeline) { String accept = pipeline.getHttpRequest().headers().get(HttpHeaderNames.ACCEPT); String contentType = httpResponse.headers().get(HttpHeaderNames.CONTENT_TYPE); - return accept != null && accept.matches("^.*text/html.*$") && contentType != null && contentType + return httpResponse.status().code() == 200 && accept != null && accept + .matches("^.*text/html.*$") && contentType != null && contentType .matches("^text/html.*$"); }