susheelgupta7 commented on code in PR #8273:
URL: https://github.com/apache/hadoop/pull/8273#discussion_r2850698568


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/ProxyUtils.java:
##########
@@ -122,4 +127,40 @@ public static void rejectNonHttpRequests(ServletRequest 
req) throws
       throw new ServletException(E_HTTP_HTTPS_ONLY);
     }
   }
+
+  /**
+   * Returns the value of a cookie with the given name from the HTTP servlet 
request.
+   * Cookie name comparison is case-insensitive. If the request contains no 
cookies
+   * or the specified cookie is not present, this method returns {@code null}.
+   *
+   * @param req the HTTP servlet request containing cookies
+   * @param cookieName the name of the cookie to retrieve
+   * @return the cookie value, or {@code null} if not found
+   */
+  public static String getCookie(HttpServletRequest req, String cookieName) {
+    Cookie[] cookies = req.getCookies();

Review Comment:
   Do we need to add validation if cookieName is null ??
   Apart from this everything looks good.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to