File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
QueueIT.Security/src/queueit/security Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -230,11 +230,14 @@ private static String getExpectedHash(String url)
230230
231231 private static void validateHash (String requestUrl , String sharedEventKey , String expectedHash ) {
232232 String stringToHash = requestUrl .substring (0 , requestUrl .length () - 32 ) + sharedEventKey ; //Remove hash value and add SharedEventKey
233- String actualHash = Hashing .getMd5Hash (stringToHash );
233+ String actualHashHttp = Hashing .getMd5Hash (stringToHash .replaceFirst ("^https://(.*)$" , "http://$1" ));
234+ String actualHashHttps = Hashing .getMd5Hash (stringToHash .replaceFirst ("^http://(.*)$" , "https://$1" ));
234235
235- if (! actualHash .equals (expectedHash )) {
236- throw new InvalidKnownUserHashException () ;
236+ if (actualHashHttp . equals ( expectedHash ) || actualHashHttps .equals (expectedHash )) {
237+ return ;
237238 }
239+
240+ throw new InvalidKnownUserHashException ();
238241 }
239242
240243 private static void validateUrl (String url ) {
You can’t perform that action at this time.
0 commit comments