Skip to content

Commit b4bfec3

Browse files
committed
Handle multi-part form case for getting salt.
1 parent 98548da commit b4bfec3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/src/main/java/org/apache/roller/weblogger/ui/core/filters/ValidateSaltFilter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public void doFilter(ServletRequest request, ServletResponse response,
6262
if (rollerSession != null) {
6363
String userId = rollerSession.getAuthenticatedUser() != null ? rollerSession.getAuthenticatedUser().getId() : "";
6464

65-
String salt = httpReq.getParameter("salt");
65+
Object saltObject = httpReq.getAttribute("salt"); // multi-form post case
66+
String salt = saltObject != null ? saltObject.toString() : null;
67+
salt = salt != null ? salt : httpReq.getParameter("salt");
6668
SaltCache saltCache = SaltCache.getInstance();
6769
if (salt == null || !Objects.equals(saltCache.get(salt), userId)) {
6870
if (log.isDebugEnabled()) {

0 commit comments

Comments
 (0)