All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.blade.security.web.xss.XssOption Maven / Gradle / Ivy

There is a newer version: 2.0.15.RELEASE
Show newest version
package com.blade.security.web.xss;

import lombok.*;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * @author biezhi
 * @date 2018/6/11
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class XssOption {

    @Builder.Default
    private Set urlExclusions = new HashSet<>();

    public XssOption exclusion(@NonNull String... urls) {
        this.urlExclusions.addAll(Arrays.asList(urls));
        return this;
    }

    public boolean isExclusion(@NonNull String url) {
        for (String excludeURL : this.urlExclusions) {
            if (url.equals(excludeURL)) {
                return true;
            }
        }
        return false;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy