0

使用 FireBug 嗅探相关候选者我通常有这个响应头:

Response Headersview source

Cache-Control   no-cache, no-store

Content-Length  0

Date    Fri, 08 Mar 2013 13:22:37 GMT

Expires Thu, 01 Jan 1970 00:00:00 GMT

Location http://c24jbs300014.test.local:8080/something/someotherthing/171330/considertakingadump?24

Pragma  no-cache

Server  Apache-Coyote/1.1

在上面的响应标头中,我将值 24 关联起来,如下所示:

        web_reg_save_param_ex(

            "ParamName=correlationID",

            "LB=considertakingadump?",

            "RB=",

            SEARCH_FILTERS,

            "Scope=Headers",

            LAST);

它被拾起,它可以像这样在脚本中关联:

    web_submit_data("submitit", 

            "Action=http://c29jbsl00015.test.local:8080/something/treatment/{someothercorrelatedvalue}/someotherstuff?{correlationID}-1.IBehaviorListener.0-tabbedPanel-content-panels-0-panel-tableBody-somepoint-0-somepoint-somepoint-somepoint", 

            "Method=POST", 

            "RecContentType=text/xml", 

            "Referer=http://c29jbsl00015.test.local:8080/something/treatment/{someothercorrelatedvalue}/someotherstuff?9", 

            "Snapshot=t63.inf", 

            "Mode=HTTP", 

            ITEMDATA, 

            "Name=valgtBeslutning", "Value=0", ENDITEM, 

            LAST);

但是,当查看日志(扩展为参数替换)时,我发现很多响应是构造 URL 的一部分,如下所示:

Action.c(618): Redirecting "http://c29jbsl00015.test.local:8080/something/treatment/171334/considerit?24&10Content-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Fri,+08+Mar+2013+13:27:35+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3Bcharset=UTF-8Transfer-Encoding:+chunked-1.ILinkListener-nesteContent-Length:+0HTTP/1.1+200+OKServer:+Apache-Coyote/1.1Date:+Fri,+08+Mar+2013+13:27:35+GMTExpires:+Thu,+01+Jan+1970+00:00:00+GMTPragma:+no-cacheCache-Control:+no-cache,+no-storeContent-Type:+text/html%3BcharsetContent-Length: 0HTTP/1.1 200 OKServer: Apache-Coyote/1.1Date: Fri, 08 Mar 2013 13:27:35 GMTExpires: Thu, 01 Jan 1970 00:00:00 GMTPragma: no-cacheCache-Control: no-cache, no-storeContent-Type: text/html;charset=UTF-8Transfer-Encoding: chunked-1.IBehaviorListener.0-tabbedPanel-content-panels-0-panel-tableBody-kontrollpunkter-0-kontrollpunkt-beslutningForm-valgtBeslutning" (redirection depth is 0)   [MsgId: MMSG-26694] 

我的服务器响应中没有正确的边界是造成这种情况的原因。

有没有办法说,即“将右边界设置为换行符 (\n)”或类似于在我的 web_reg_save_param() 中截断这个长而无用的信息的东西?在我的服务器响应中的数字 24 之后?

4

2 回答 2

3

是的,您可以使用不可见的控制字符,例如 \r,\n,\t, .... 作为左边界条件或右边界条件。

如果您有一个始终以“location”开头的可变内容行,以您需要最后两个字符的“\n”结尾,那么您始终可以捕获整行,然后使用 C 的标准字符串处理功能来提取行的最后两个字符,例如玩“将指针移动”到字符串的最后两个字符的游戏

&lr_eval_string("{My_captured_long_line}")[strlen(lr_eval_string("{My_captured_long_line}")) -2]
于 2013-03-08T14:41:17.867 回答
3

为什么不使用 SaveLen

web_reg_save_param_ex(

        "ParamName=correlationID",

        "LB=considertakingadump?",

        "RB=",

                      "savelen=2",

        SEARCH_FILTERS,

        "Scope=Headers",

        LAST);
于 2013-03-24T05:59:18.130 回答