Content-Type: 5a Filter sel. Text Types

sidki config set的配置、使用,新手入门首选

Moderator: phoenix

Post Reply
red
Posts: 99
Joined: Mar 09 2010, 16:25

Content-Type: 5a Filter sel. Text Types

Post by red » Jun 29 2011, 18:19

网址http://club.china.com/data/thread/1011/ ... 0/5_1.html
使用浏览器opera打开,会有跳出下载对话框。实际是此页面问题,http://r.club.china.com/SoundOfSilence? ... =271117005,bypass incoming header后正常
以下是未bypass incoming header时的log,返回的Content-Type为空?

Code: Select all

GET /SoundOfSilence?forumid=1011&threadid=271117005 HTTP/1.1
User-Agent: Opera/9.80 (Windows NT 6.1; U) Version/11.59
Host: r.club.china.com
Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Accept-Encoding: gzip,deflate
Connection: keep-alive
RESP 13863 : Content-Type: Filter True: 
不知是Content-Type: 5a Filter sel. Text Types这条规则有问题还是opera的问题
ff未测试

User avatar
phoenix
Site Admin
Posts: 525
Joined: Dec 29 2007, 16:27

Re: Content-Type: 5a Filter sel. Text Types

Post by phoenix » Jun 30 2011, 23:24

原来返回的 headers 中没有 Content-Type,经 sidki 的规则处理后,会增加如下的 header:

Code: Select all

Content-Type: ; PrxMsg: Filter Text: No Content-Type
这个增加的部分,测试了 FireFox 5 和 IE8 都不会出现下载对话框,而 Opera 11.5 会出现。

sidki 原来的规则中有这么一部分:

Code: Select all

($TST(hOrigUA=*msie(^*opera)*)$SET(1=text/plain)|)
作用是,如果浏览器是 IE ,则增加的 header 变为如下形式,推测是为了避免 IE 出现下载对话框。

Code: Select all

Content-Type: text/plain; PrxMsg: Filter Text: No Content-Type
但目前的情况是 IE 已无此问题,而 Opera 11.5 有此问题,所以我们可将其改为:

Code: Select all

($TST(hOrigUA=*opera*)$SET(1=text/plain)|)
修订后的完整规则如下:

Code: Select all

[HTTP headers]
In = TRUE
Out = FALSE
Key = "Content-Type: 5a Filter sel. Text Types     09.05.14 [sd] (d.r l.3) (In) TEST"
URL = "^$RESP(204|3|*No headers$TST(uPort=:(^443)*))|$TST(hRealCT=*)|$TST(keyword=*.(a_headers|a_type_t|i_level:[12]).*)|$TST(volat=*.post:1.*)|$TST(uExt=exe|gz)"
Match = "text/plain(^*; Prx(^Msg: Fixed acc. to Original))$SET(1=\0)|(\*/\*$SET(2=: \0)|(^?)$SET(2=: No Content-Type))($TST(hOrigUA=*opera*)$SET(1=text/plain)|)&\0&($TST(volat=*.log:2*)$ADDLST(Log-Main,[$DTM(d T)]\tHDR_In CT_FilterTrue\t\1\2 \t\u)|)($TST(\0=\**)$TST(volat=*.log:[12]c.*)$ADDLST(Log-Rare,HDR_In CT_FilterTrue\t\1\2 \t\u)|)$LOG(CRESP $DTM(c) : Content-Type: Filter True: \1)"
Replace = "\1; PrxMsg: Filter Text\2$SET(hRealCT=filter)$FILTER(1)"

Post Reply