Only set content-type if not already determined
Fixed memory leaks and file handle leaks.
Simplified config example
Merge pull request #2 from demellj/master

Fixed memory and file handle leaks and a content-type bug.