arina-ielchiieva commented on a change in pull request #1864: DRILL-7351: Added 
tokens to Web forms to prevent CSRF attacks
URL: https://github.com/apache/drill/pull/1864#discussion_r339080122
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java
 ##########
 @@ -124,7 +126,7 @@ public QueryPage(WorkManager work, HttpServletRequest 
request) {
       onlyImpersonationEnabled = WebServer.isOnlyImpersonationEnabled(config);
       autoLimitEnabled = 
config.getBoolean(ExecConstants.HTTP_WEB_CLIENT_RESULTSET_AUTOLIMIT_CHECKED);
       defaultRowsAutoLimited = 
config.getInt(ExecConstants.HTTP_WEB_CLIENT_RESULTSET_AUTOLIMIT_ROWS);
-      csrfToken = Utilities.getCsrfTokenFromHttpRequest(request);
+      csrfToken = 
Optional.ofNullable(WebUtils.getCsrfTokenFromHttpRequest(request)).orElse("");
 
 Review comment:
   Well, then I guess it's better to return to your previous solution where 
returned `WebUtils.getCsrfTokenFromHttpRequest` empty string when null...

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to