java - Whitelist validation for http request -
i trying create servlet request filter filters incoming request based on whitelist characters.
i want accept characters matches whitelist pattern avoid malicious code executed attacker in form of script or modified url.
does know whitelist characters should used filtering http request string?
any appreciated
thanks in advance
implement pattern matching mechanism find whitelist characters url pattern using regex..
follow link1
or can try:
if (inputurl.contains(whitelist)) { // code goes here }
or if need know occurs, can use indexof:
int index = inputurl.indexof(whitelist); if (index != -1) // -1 means "not found" { ... }
thanks,
~chandan
Comments
Post a Comment