File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/Platform_Core/org/lobobrowser/context Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -57,13 +57,20 @@ private static List<AlgorithmDigest> getHashes(final String[] tokens) {
5757 }
5858 final String alg = token .substring (0 , hyphen );
5959 if (str .containsKey (alg )) {
60- final AlgorithmDigest ag = new AlgorithmDigest (alg , token .substring (hyphen + 1 ), str .get (alg ));
60+ final String hashWithOptions = token .substring (hyphen + 1 );
61+ final String hash = parseHashExpression (hashWithOptions );
62+ final AlgorithmDigest ag = new AlgorithmDigest (alg , hash , str .get (alg ));
6163 hashes .add (ag );
6264 }
6365 }
6466 return hashes ;
6567 }
6668
69+ private static String parseHashExpression (final String hashWithOptions ) {
70+ final int question = hashWithOptions .indexOf ("?" );
71+ return (question < 0 ) ? hashWithOptions : hashWithOptions .substring (0 , question );
72+ }
73+
6774 public static List <AlgorithmDigest > strongestAlgDigests (final List <AlgorithmDigest > hashes ) {
6875 Collections .sort (hashes , (a , b ) -> a .compareTo (b ));
6976 final Integer strongest = hashes .get (0 ).strength ;
You can’t perform that action at this time.
0 commit comments