I would like to be able to prevent someone from hotlinking to my images. The general solution, which I want to implement, is a check for my own domain in the Referer header.

I saw preWriteCallback() as a handler that can be attached to serveStaticFiles(), but it's not clear if this has the ability to block the file contents from being sent, and there's no usage documentation.

Any tips?