Java Code Examples for org.springframework.security.web.firewall.StrictHttpFirewall#setAllowUrlEncodedPercent()

The following examples show how to use org.springframework.security.web.firewall.StrictHttpFirewall#setAllowUrlEncodedPercent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SecurityConfiguration.java    From api-layer with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void configure(WebSecurity web) {
    StrictHttpFirewall firewall = new StrictHttpFirewall();
    firewall.setAllowUrlEncodedSlash(true);
    firewall.setAllowBackSlash(true);
    firewall.setAllowUrlEncodedPercent(true);
    firewall.setAllowUrlEncodedPeriod(true);
    firewall.setAllowSemicolon(true);
    web.httpFirewall(firewall);

    web.ignoring()
        .antMatchers(AuthController.CONTROLLER_PATH + AuthController.PUBLIC_KEYS_PATH + "/**");
}
 
Example 2
Source File: SecurityConfiguration.java    From find with MIT License 5 votes vote down vote up
public static StrictHttpFirewall firewallAllowingUrlEncodedCharacters() {
    final StrictHttpFirewall firewall = new StrictHttpFirewall();

    // We use encoded IDOL field names, e.g.
    //   'api/public/parametric/numeric/buckets/NODE_PLACE%252FPLACE_POPULATION'
    // so we have to allow these fields through.
    firewall.setAllowUrlEncodedPercent(true);
    firewall.setAllowUrlEncodedPeriod(true);
    firewall.setAllowUrlEncodedSlash(true);

    return firewall;
}
 
Example 3
Source File: MySecurityConfig.java    From zfile with MIT License 4 votes vote down vote up
@Bean
public HttpFirewall allowUrlEncodedSlashHttpFirewall() {
    StrictHttpFirewall firewall = new StrictHttpFirewall();
    firewall.setAllowUrlEncodedPercent(true);
    return firewall;
}