Skip to content

Commit

Permalink
Use Set.of()
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannah-PortSwigger authored Apr 15, 2024
1 parent e23322f commit c96b0f8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Filter/Proxy/HTTP/DetectServerNames.bambda
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Configuration setting for manual annotations
boolean enableManualAnnotations = true;

Set<String> serverNames = new HashSet<>(Arrays.asList(
Set<String> serverNames = Set.of(
"awselb", "Kestrel", "Apache", "Nginx", "Microsoft-IIS", "LiteSpeed", "Google Frontend",
"GWS", "openresty", "IBM_HTTP_Server", "AmazonS3", "CloudFront", "AkamaiGHost", "Jetty",
"Tengine", "lighttpd", "AOLserver", "ATS", "Boa", "Caddy", "Cherokee", "Caudium", "Hiawatha",
Expand All @@ -25,10 +25,7 @@ Set<String> serverNames = new HashSet<>(Arrays.asList(
"Thttpd", "Swiki", "SurgeLDAP", "Sun-ONE-Web-Server", "Sun-ONE-Application-Server",
"Sucuri/Cloudproxy", "SSWS", "SWS", "SW", "srv", "squid", "Spamfire", "SOMA",
"Snap", "SmugMug", "SME Server", "Smart-4-Hosting", "Sioux", "SilverStream", "Silk", "Siemens Gigaset WLAN Camera"
));

// Convert HashSet to an Immutable Set
Set<String> immutableServerNames = Set.copyOf(serverNames);
);

// Ensure there is a response
if (!requestResponse.hasResponse()) {
Expand Down

0 comments on commit c96b0f8

Please sign in to comment.