MCPcopy Create free account
hub / github.com/WindXaa/Android-reverse / marcherServer

Method marcherServer

WebCurl/WebCurl.java:415–453  ·  view source on GitHub ↗
(WebInfo wi,String strcontent)

Source from the content-addressed store, hash-verified

413 * 例如:Apache 顺序:Http->Date->Server
414 */
415 public static void marcherServer(WebInfo wi,String strcontent) throws IOException {
416 if(!strcontent.isEmpty()) {
417 BufferedReader br = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(strcontent.getBytes(Charset.forName("utf-8")))));
418 String line;
419 int i=0;
420 StringBuffer strbuf = new StringBuffer();
421 while ((line = br.readLine()) != null) {
422 i=i+1;
423 if(line.contains("HTTP")&&i==1){
424 // i=2;
425 }
426 if(line.contains("Date")&&i==2){
427 wi.http_server="Apache";
428 break;
429 }
430 if(line.contains("Server")&&i==2){
431 //i=3;
432 }
433 if(line.contains("Expires")&&i==3){
434 wi.http_server="IIS";
435 break;
436 }
437 if(line.contains("Data")&&i==3){
438 //i=4;
439 }
440 if(line.contains("Content-Type")&&i==4){
441 wi.http_server="Enterprise ";
442 break;
443 }
444 if(line.contains("Content-length")&&i==4){
445 wi.http_server="SunONE";
446 break;
447 }
448 if(i==5){
449 break;
450 }
451 }
452 }
453 }
454 /*
455 * 正则表达式匹配:输入字符串、正则表达式
456 * 例如:reg3 = "Server:\\s(\\D*)(\\s|\/)(.*)";

Callers 1

strNameMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected