You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2022/01/12 11:06:02 UTC

[GitHub] [sling-org-apache-sling-security] kwin commented on a change in pull request #4: handled invalid referrer ?://

kwin commented on a change in pull request #4:
URL: https://github.com/apache/sling-org-apache-sling-security/pull/4#discussion_r782959317



##########
File path: src/main/java/org/apache/sling/security/impl/ReferrerFilter.java
##########
@@ -383,6 +383,10 @@ boolean isValidRequest(final HttpServletRequest request) {
         if ( referrer.indexOf(":/") == - 1 ) {
             return true;
         }
+        //invalid referrer
+        if("?://".equals(referrer)){

Review comment:
       You can probably just improve the if condition in line 346

##########
File path: src/main/java/org/apache/sling/security/impl/ReferrerFilter.java
##########
@@ -383,6 +383,10 @@ boolean isValidRequest(final HttpServletRequest request) {
         if ( referrer.indexOf(":/") == - 1 ) {
             return true;
         }
+        //invalid referrer
+        if("?://".equals(referrer)){

Review comment:
       let us rather improve getHost() as there might be more invalid referrer hosts




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org