You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "thiagohp (via GitHub)" <gi...@apache.org> on 2026/07/18 14:23:19 UTC

Re: [PR] TAP5-2832: LocalhostOnly detect IPv6 correctly [tapestry-5]

thiagohp commented on code in PR #64:
URL: https://github.com/apache/tapestry-5/pull/64#discussion_r3608524594


##########
tapestry-http/src/main/java/org/apache/tapestry5/http/services/Request.java:
##########
@@ -209,6 +209,15 @@ public interface Request
      */
     String getRemoteHost();
 
+    /**
+     * Returns the IP address of the client or last proxy that sent the request,
+     * always as a numeric address string (never a hostname).
+     *
+     * @return a <code>String</code> containing the IP address of the client that sent the request
+     * @since 5.10
+     */
+    String getRemoteAddr();

Review Comment:
   For backward compatibility purposes, couldn't we make this a default method that returns null? Or maybe return type Optional<String> and return Optional.empty() by default? While we cannot change the existing Tapestry methods that may return null to return Optional instead, I believe we should try to use them for new methods we introduce in Java interfaces.



-- 
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@tapestry.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org