{"action":"created","issue":{"url":"https://api.github.com/repos/vonKingsley/hi8.cr/issues/2","repository_url":"https://api.github.com/repos/vonKingsley/hi8.cr","labels_url":"https://api.github.com/repos/vonKingsley/hi8.cr/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/vonKingsley/hi8.cr/issues/2/comments","events_url":"https://api.github.com/repos/vonKingsley/hi8.cr/issues/2/events","html_url":"https://github.com/vonKingsley/hi8.cr/issues/2","id":294259880,"number":2,"title":"Base URL \"doubling\" when using Cossack::Client","user":{"login":"aisrael","id":89215,"avatar_url":"https://avatars1.githubusercontent.com/u/89215?v=4","gravatar_id":"","url":"https://api.github.com/users/aisrael","html_url":"https://github.com/aisrael","followers_url":"https://api.github.com/users/aisrael/followers","following_url":"https://api.github.com/users/aisrael/following{/other_user}","gists_url":"https://api.github.com/users/aisrael/gists{/gist_id}","starred_url":"https://api.github.com/users/aisrael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aisrael/subscriptions","organizations_url":"https://api.github.com/users/aisrael/orgs","repos_url":"https://api.github.com/users/aisrael/repos","events_url":"https://api.github.com/users/aisrael/events{/privacy}","received_events_url":"https://api.github.com/users/aisrael/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-05T02:55:43Z","updated_at":"2018-02-05T21:27:13Z","closed_at":"2018-02-05T21:27:13Z","author_association":"CONTRIBUTOR","body":"#### Issue Summary\r\n\r\nAm trying to use Hi8 to automatically record and playback HTTP interactions for a Web service client, but am using [Cossack](https://github.com/crystal-community/cossack) rather than just `HTTP::Client`.\r\n\r\nThe first time the spec is executed, it passes and HI8 records the interaction as expected. However, subsequent test runs fail with `Real HTTP connections are disabled. Unregistered request: ...`.\r\n\r\nFurther investigation reveals that the recorded `uri` in the cassette has the base URL \"doubled\". E.g., `\"https://api.fixer.io/latest\"` becomes `\"https://api.fixer.iohttps://api.fixer.io/latest\"`.\r\n\r\nThe same behaviour was not observed using whether using `HTTP::Client.get()` or `HTTP::Client.new()`.\r\n\r\n#### Sample code\r\n\r\n```\r\n    HI8.use_cassette(\"using_cossack_client\") do\r\n      client = Cossack::Client.new(\"https://api.fixer.io\")\r\n      resp = client.get(\"/latest?base=USD\")\r\n      resp.status.should eq(200)\r\n    end\r\n```\r\nThe full gist can be found at [here](https://gist.github.com/aisrael/958841742d3c63b1ba5b86ac54cb5c60)\r\n\r\n#### Expected behaviour\r\n\r\nSpec should pass.\r\n\r\n#### Actual behaviour\r\n\r\n```\r\nReal HTTP connections are disabled. Unregistered request: GET https://api.fixer.iohttps://api.fixer.io/latest?base=USD with headers {\"User-Agent\" => \"Cossack v0.1.4\", \"Host\" => \"api.fixer.io\"}\r\n```\r\n\r\n#### Environment\r\n\r\n* Hi8 commit: 1e9981ab94846ffa2e6f6635f2649ac51d42d3b6\r\n* Crystal 0.24.1\r\n* Cossack 0.1.4\r\n* macOS 10.13.3"},"comment":{"url":"https://api.github.com/repos/vonKingsley/hi8.cr/issues/comments/363226851","html_url":"https://github.com/vonKingsley/hi8.cr/issues/2#issuecomment-363226851","issue_url":"https://api.github.com/repos/vonKingsley/hi8.cr/issues/2","id":363226851,"user":{"login":"vonKingsley","id":6889313,"avatar_url":"https://avatars3.githubusercontent.com/u/6889313?v=4","gravatar_id":"","url":"https://api.github.com/users/vonKingsley","html_url":"https://github.com/vonKingsley","followers_url":"https://api.github.com/users/vonKingsley/followers","following_url":"https://api.github.com/users/vonKingsley/following{/other_user}","gists_url":"https://api.github.com/users/vonKingsley/gists{/gist_id}","starred_url":"https://api.github.com/users/vonKingsley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vonKingsley/subscriptions","organizations_url":"https://api.github.com/users/vonKingsley/orgs","repos_url":"https://api.github.com/users/vonKingsley/repos","events_url":"https://api.github.com/users/vonKingsley/events{/privacy}","received_events_url":"https://api.github.com/users/vonKingsley/received_events","type":"User","site_admin":false},"created_at":"2018-02-05T21:27:13Z","updated_at":"2018-02-05T21:27:13Z","author_association":"OWNER","body":"Your fix works for me.  I'll close this out."}}
{"actor":{"display_login":"vonKingsley"}}