{"action":"closed","issue":{"url":"https://api.github.com/repos/joyent/gosign/issues/8","repository_url":"https://api.github.com/repos/joyent/gosign","labels_url":"https://api.github.com/repos/joyent/gosign/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/joyent/gosign/issues/8/comments","events_url":"https://api.github.com/repos/joyent/gosign/issues/8/events","html_url":"https://github.com/joyent/gosign/issues/8","id":159801374,"number":8,"title":"Region() method crashes if SDC_URL has a trailing '/'","user":{"login":"sodre","id":1043285,"avatar_url":"https://avatars.githubusercontent.com/u/1043285?v=3","gravatar_id":"","url":"https://api.github.com/users/sodre","html_url":"https://github.com/sodre","followers_url":"https://api.github.com/users/sodre/followers","following_url":"https://api.github.com/users/sodre/following{/other_user}","gists_url":"https://api.github.com/users/sodre/gists{/gist_id}","starred_url":"https://api.github.com/users/sodre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sodre/subscriptions","organizations_url":"https://api.github.com/users/sodre/orgs","repos_url":"https://api.github.com/users/sodre/repos","events_url":"https://api.github.com/users/sodre/events{/privacy}","received_events_url":"https://api.github.com/users/sodre/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-12T01:05:10Z","updated_at":"2016-06-16T18:51:20Z","closed_at":"2016-06-16T18:51:20Z","body":"Steps to reproduce:\r\n\r\n- `export SDC_URL=\"http://us-east-1.api.joyentcloud.com/\"`\r\n- Run anything that depends on gosign, .e.g. terraform scripts.\r\n- Receive something like\r\n```console\r\npanic: runtime error: slice bounds out of range\r\n\r\ngoroutine 50 [running]:\r\npanic(0x72db80, 0xc82000e0d0)\r\n\t/usr/local/Cellar/go/1.6.1/libexec/src/runtime/panic.go:464 +0x3e6\r\ngithub.com/hashicorp/terraform/vendor/github.com/joyent/gosign/auth.(*Credentials).Region(0xc82035b720, 0x0, 0x0)\r\n\t/Users/sodre/go/src/github.com/hashicorp/terraform/vendor/github.com/joyent/gosign/auth/auth.go:122 +0x11c\r\ngithub.com/hashicorp/terraform/vendor/github.com/joyent/gocommon/http.getDateForRegion(0xc82035b720, 0x818700, 0x0, 0x0)\r\n\t/Users/sodre/go/src/github.com/hashicorp/terraform/vendor/github.com/joyent/gocommon/http/client.go:135 +0x169\r\ngithub.com/hashicorp/terraform/vendor/github.com/joyent/gocommon/http.createHeaders(0x0, 0xc82035b720, 0x8938b0, 0x10, 0x0, 0x0, 0x81eb10, 0x4, 0x0, 0xe, ...)\r\n\t/Users/sodre/go/src/github.com/hashicorp/terraform/vendor/github.com/joyent/gocommon/http/client.go:116 +0x4e6\r\ngithub.com/hashicorp/terraform/vendor/github.com/joyent/gocommon/http.(*Client).JsonRequest(0xc82035f680, 0x819f00, 0x4, 0xc82038\r\n...\r\n```\r\n\r\nA fix is to have the code in Region use a URL parsing library instead of looking for the last '/'."}}
{"actor":{"display_login":"twhiteman"}}