Skip to content

Commit

Permalink
it's never ending story
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Anisimov committed Dec 17, 2020
1 parent 2044221 commit bf1beb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.io.Serializable;

import static com.vaadin.flow.server.InitParameters.SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION;
import static com.vaadin.flow.server.InitParameters.SERVLET_PARAMETER_USE_V14_BOOTSTRAP;

/**
Expand Down Expand Up @@ -111,6 +112,9 @@ default boolean isPnpmEnabled() {
*
* @return true if XSRF protection is enabled, false otherwise.
*/
boolean isXsrfProtectionEnabled();
default boolean isXsrfProtectionEnabled() {
return !getBooleanProperty(SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION,
false);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ public boolean isRequestTiming() {
@Override
public boolean isXsrfProtectionEnabled() {
if (isOwnProperty(SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION)) {
return !getBooleanProperty(
SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION, false);
return super.isXsrfProtectionEnabled();
}
return parentConfig.isXsrfProtectionEnabled();
}
Expand Down

0 comments on commit bf1beb4

Please sign in to comment.