Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #375 from ppalaga/150729-aspnet
Browse files Browse the repository at this point in the history
Do not show ASP.NET trait twice with and without the version
  • Loading branch information
pilhuhn committed Jul 29, 2015
2 parents 4f07e21 + e12c35a commit e311dde
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public static Traits collect(HttpResponse httpResponse, long timestamp, InetAddr
xPoweredBy = new TreeSet<>();
}
xPoweredBy.add(ASP_NET +"/"+ header.getValue());
hasAspNet = true;
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public void testCollectAspnetVersion() {

Assert.assertEquals("ARR/2.5, ASP.NET/1.2.3", found);


response = new BasicHttpResponse(HttpVersion.HTTP_1_0, HttpStatus.SC_OK, "OK");
response.addHeader("X-Aspnet-Version", "1.2.3");
response.addHeader("X-Powered-By", "ARR/2.5");
Expand All @@ -128,5 +129,15 @@ public void testCollectAspnetVersion() {
Assert.assertEquals("ARR/2.5, ASP.NET/1.2.3", found);


response = new BasicHttpResponse(HttpVersion.HTTP_1_0, HttpStatus.SC_OK, "OK");
response.addHeader("Server", "Microsoft-IIS/8.0");
response.addHeader("X-Aspnet-Version", "1.2.3");
response.addHeader("X-Powered-By", "ASP.NET");

found = Traits.collect(response, 0, null).getPoweredBy();

Assert.assertEquals("Microsoft-IIS/8.0, ASP.NET/1.2.3", found);


}
}

0 comments on commit e311dde

Please sign in to comment.