as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write a middleware program to filter all incoming requests on a website
user
the program should function as an intermediary between the request and the response, and should include several layers for security. it should include input validation to weed out malicious requests, as well as content filtering to reject inappropriate requests such as those containing profanity or containing scripts. it should also evaluate requests against a blacklist of known malicious sites or ips, as well as a whitelist of known valid sites.
assistant