Fix bug in parsing http options
Add tests for http options