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_r334647292
##########
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:
I am still unclear why token should be defaulted to empty String...
Why we can't just return it as 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