sahi jar lib定制处理

/ 测试开发 / 0 条评论 / 81浏览

首先打开log 然后进sahi/userdata/log目录查看具体问题
令牌


sahi\lib\sahi.jar 定制完替换即可
1. HttpRequest
if (isPost() || (isDelete() ) || isPut() ) {//&&!firstLine().contains("logout")
    if(contentLength() != -1)
        populateData(in);
}
if (isPost() || isGet() || isPut() || isDelete() || isConnect()) {
    setHostAndPort();
    setUri();
    setQueryString();
}

2. RemoteRequestProcessor
if (requestFromBrowser.isPost() || requestFromBrowser.isPut() || requestFromBrowser.isDelete()){

if(requestFromBrowser.data() != null) {
    outputStreamToHost.write(requestFromBrowser.data());
}else {
    outputStreamToHost.write("".getBytes());
}

3. requestFromBrowser.modifyForFetch();
//removeHeader("Accept-Encoding");
//addHeader("Accept-Encoding", "gzip");
removeHeader("Keep-Alive");
removeHeader("sahi-isxhr");
//        Not sure whether Authorization and Proxy-Authorization should be removed.
//removeHeader("Authorization");