Http traversal fixes

This patches fixes two things:

1. Assigning datastore options ```METHOD``` and ```DATA``` directly, which is flagged by msftidy.
2. Possible file handle leak if there's an exception or whatever