@@ -110,19 +110,18 @@ protected void mergeData(ServerReport report) {
110110 for (HttpHeader header : headerList ) {
111111 if (header .getHeaderName ()
112112 .getValue ()
113- .toLowerCase ()
114- .equals ("strict-transport-security" )) {
113+ .equalsIgnoreCase ("strict-transport-security" )) {
115114 supportsHsts = TestResults .TRUE ;
116115 boolean preload = false ;
117116 String [] values = header .getHeaderValue ().getValue ().split (";" );
118117 for (String value : values ) {
119- if (value .trim ().startsWith ("preload" )) {
118+ if (value .trim ().toLowerCase (). startsWith ("preload" )) {
120119 preload = true ;
121120 }
122- if (value .trim ().startsWith ("includeSubDomains " )) {
121+ if (value .trim ().toLowerCase (). startsWith ("includesubdomains " )) {
123122 hstsIncludesSubdomains = TestResults .TRUE ;
124123 }
125- if (value .trim ().startsWith ("max-age" )) {
124+ if (value .trim ().toLowerCase (). startsWith ("max-age" )) {
126125 String [] maxAge = value .split ("=" );
127126 if (maxAge .length == 2 ) {
128127 try {
@@ -138,14 +137,14 @@ protected void mergeData(ServerReport report) {
138137 }
139138 supportsHstsPreloading = preload == true ? TestResults .TRUE : TestResults .FALSE ;
140139 }
141- if (header .getHeaderName ().getValue ().equals ("Public-Key-Pins" )) {
140+ if (header .getHeaderName ().getValue ().equalsIgnoreCase ("Public-Key-Pins" )) {
142141 supportsHpkp = TestResults .TRUE ;
143142 String [] values = header .getHeaderValue ().getValue ().split (";" );
144143 for (String value : values ) {
145- if (value .trim ().startsWith ("includeSubDomains " )) {
144+ if (value .trim ().toLowerCase (). startsWith ("includesubdomains " )) {
146145 hpkpIncludesSubdomains = TestResults .TRUE ;
147146 }
148- if (value .trim ().startsWith ("max-age" )) {
147+ if (value .trim ().toLowerCase (). startsWith ("max-age" )) {
149148 String [] maxAge = value .split ("=" );
150149 if (maxAge .length == 2 ) {
151150 try {
@@ -172,14 +171,16 @@ protected void mergeData(ServerReport report) {
172171 }
173172 }
174173 }
175- if (header .getHeaderName ().getValue ().equals ("Public-Key-Pins-Report-Only" )) {
174+ if (header .getHeaderName ()
175+ .getValue ()
176+ .equalsIgnoreCase ("Public-Key-Pins-Report-Only" )) {
176177 supportsHpkpReportOnly = TestResults .TRUE ;
177178 String [] values = header .getHeaderValue ().getValue ().split (";" );
178179 for (String value : values ) {
179- if (value .trim ().startsWith ("includeSubDomains " )) {
180+ if (value .trim ().toLowerCase (). startsWith ("includesubdomains " )) {
180181 hpkpIncludesSubdomains = TestResults .TRUE ;
181182 }
182- if (value .trim ().startsWith ("max-age" )) {
183+ if (value .trim ().toLowerCase (). startsWith ("max-age" )) {
183184 String [] maxAge = value .split ("=" );
184185 if (maxAge .length == 2 ) {
185186 try {
@@ -192,7 +193,7 @@ protected void mergeData(ServerReport report) {
192193 hpkpNotParseable = TestResults .FALSE ;
193194 }
194195 }
195- if (value .trim ().startsWith ("pin-" )) {
196+ if (value .trim ().toLowerCase (). startsWith ("pin-" )) {
196197 try {
197198 String [] pinString = value .split ("=" );
198199 HpkpPin pin =
@@ -208,14 +209,15 @@ protected void mergeData(ServerReport report) {
208209 }
209210 }
210211 }
211- if (header .getHeaderName ().getValue ().equals ("Content-Encoding" )) {
212+ if (header .getHeaderName ().getValue ().equalsIgnoreCase ("Content-Encoding" )) {
212213 String compressionHeaderValue = header .getHeaderValue ().getValue ();
213214 String [] compressionAlgorithms = {
214215 "compress" , "deflate" , "exi" , "gzip" , "br" , "bzip2" , "lzma" , "xz"
215216 };
216217 for (String compression : compressionAlgorithms ) {
217- if (compressionHeaderValue .contains (compression )) {
218+ if (compressionHeaderValue .toLowerCase (). contains (compression )) {
218219 vulnerableBreach = TestResults .TRUE ;
220+ break ;
219221 }
220222 }
221223 }
0 commit comments