Skip to content

Commit

Permalink
webdav/frontend: fix IllegalArgumentException "not an IP string literal"
Browse files Browse the repository at this point in the history
Motivation:

Commit 8e4d90e merged commit c0e8abf from dependabot[bot]
<support@github.com> that resolves a security vulnerability by bumping
the Jetty version from 9.4.18.v20190429 to 9.4.34.v20201102.

This new version of Jetty resolves issue jetty/jetty.project#5079,
with the effect that HttpServletRequest#getRemoteAddr now returns IPv6
addresses in square brackets.

Previously, the getRemoteAddr method returned IPv6 addresses without
square brackets.

The change in format means that calling InetAddresses.forString throws
an IllegalArgumentException if dCache's WebDAV or frontend is used with
an IPv6 address.

Modification:

Update Guava usage to a method that expects IPv6 addresses in square
brackets.

Result:

dCache WebDAV and frontend now work with IPv6 interfaces.

Target: master
Requires-notes: no
Requires-book: no
  • Loading branch information
paulmillar committed Nov 16, 2020
1 parent 9499bec commit db66d57
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -87,7 +87,7 @@ protected void describeOperation(NetLoggerBuilder log,
log.add("response.code", response.getStatus());
log.add("response.reason", getReason(response));
log.add("location", response.getHeader("Location"));
InetAddress addr = InetAddresses.forString(request.getRemoteAddr());
InetAddress addr = InetAddresses.forUriString(request.getRemoteAddr());
log.add("socket.remote", new InetSocketAddress(addr, request.getRemotePort()));
log.add("user-agent", request.getHeader("User-Agent"));

Expand Down

0 comments on commit db66d57

Please sign in to comment.