You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2021/04/07 21:00:52 UTC

[jena] branch main updated: Handle shortened IpV6 as resolved by chrome

This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git


The following commit(s) were added to refs/heads/main by this push:
     new 7bf9acc  Handle shortened IpV6 as resolved by chrome
     new b10d5ff  Merge pull request #981 from sparkhi/main
7bf9acc is described below

commit 7bf9accade29db6c7204eab66f4576d008037ca9
Author: sparkhi <pa...@gmail.com>
AuthorDate: Wed Apr 7 15:26:37 2021 +0100

    Handle shortened IpV6 as resolved by chrome
---
 .../src/main/java/org/apache/jena/fuseki/authz/LocalhostFilter.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/jena-fuseki2/jena-fuseki-webapp/src/main/java/org/apache/jena/fuseki/authz/LocalhostFilter.java b/jena-fuseki2/jena-fuseki-webapp/src/main/java/org/apache/jena/fuseki/authz/LocalhostFilter.java
index b77de41..e637301 100644
--- a/jena-fuseki2/jena-fuseki-webapp/src/main/java/org/apache/jena/fuseki/authz/LocalhostFilter.java
+++ b/jena-fuseki2/jena-fuseki-webapp/src/main/java/org/apache/jena/fuseki/authz/LocalhostFilter.java
@@ -53,14 +53,14 @@ public class LocalhostFilter extends AuthorizationFilter403 {
 
     private static String LOCALHOST_IpV6_a = "[0:0:0:0:0:0:0:1]";
     private static String LOCALHOST_IpV6_b = "0:0:0:0:0:0:0:1";
+    private static String LOCALHOST_IpV6_c = "[::1]";
     private static String LOCALHOST_IpV4 =  "127.0.0.1";   // Strictly, 127.*.*.*
 
     private static final Collection<String> localhosts = new HashSet<>(
-        Arrays.asList(LOCALHOST_IpV4, LOCALHOST_IpV6_a, LOCALHOST_IpV6_b));  
+        Arrays.asList(LOCALHOST_IpV4, LOCALHOST_IpV6_a, LOCALHOST_IpV6_b, LOCALHOST_IpV6_c));
 
     @Override
     protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
-        String remoteAddr = request.getRemoteAddr();
         return localhosts.contains(request.getRemoteAddr());
     }
 }