Also, is it common idiom in Go to both defer f.Close() and manually call f.Close()? Seems noisy to me (and would, in many other systems, give an error when the deferred code tries to close an already closed file)
Other issue: from glancing at the code, the 403 page doesn’t seem to return a 403 status code.
It’s inefficient to read the list of swear words every time swearfilter is called (and similarly for checkban and checkAdminIP)
The way it is implemented, you’ll also have quite a few false positives (https://en.wikipedia.org/wiki/Scunthorpe_problem)
Also, is it common idiom in Go to both defer f.Close() and manually call f.Close()? Seems noisy to me (and would, in many other systems, give an error when the deferred code tries to close an already closed file)
Other issue: from glancing at the code, the 403 page doesn’t seem to return a 403 status code.