{"action":"created","issue":{"url":"https://api.github.com/repos/sourcegraph/appdash/issues/162","repository_url":"https://api.github.com/repos/sourcegraph/appdash","labels_url":"https://api.github.com/repos/sourcegraph/appdash/issues/162/labels{/name}","comments_url":"https://api.github.com/repos/sourcegraph/appdash/issues/162/comments","events_url":"https://api.github.com/repos/sourcegraph/appdash/issues/162/events","html_url":"https://github.com/sourcegraph/appdash/pull/162","id":151827219,"number":162,"title":"traceapp: take a base URL parameter in New","user":{"login":"slimsag","id":3173176,"avatar_url":"https://avatars.githubusercontent.com/u/3173176?v=3","gravatar_id":"","url":"https://api.github.com/users/slimsag","html_url":"https://github.com/slimsag","followers_url":"https://api.github.com/users/slimsag/followers","following_url":"https://api.github.com/users/slimsag/following{/other_user}","gists_url":"https://api.github.com/users/slimsag/gists{/gist_id}","starred_url":"https://api.github.com/users/slimsag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimsag/subscriptions","organizations_url":"https://api.github.com/users/slimsag/orgs","repos_url":"https://api.github.com/users/slimsag/repos","events_url":"https://api.github.com/users/slimsag/events{/privacy}","received_events_url":"https://api.github.com/users/slimsag/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-29T09:32:25Z","updated_at":"2016-05-10T01:28:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sourcegraph/appdash/pulls/162","html_url":"https://github.com/sourcegraph/appdash/pull/162","diff_url":"https://github.com/sourcegraph/appdash/pull/162.diff","patch_url":"https://github.com/sourcegraph/appdash/pull/162.patch"},"body":"This change requires that users of traceapp pass a base URL parameter. This is\r\nneeded in order to create absolute URLs to e.g. traces for permalinks. Prior to\r\nthis change, we would get this base URL via `github.com/gorilla/mux.Route.URLTo`\r\nbut this notably enforces an HTTP-only scheme ([source code here](https://github.com/gorilla/mux/blob/master/route.go#L473))\r\nwhich prevents Appdash permalinks from working on HTTPS hosted systems. This is\r\nfixed with this change, by requiring an explicit base URL to be given as a\r\nparameter.\r\n\r\nVerified as working manually via the examples."},"comment":{"url":"https://api.github.com/repos/sourcegraph/appdash/issues/comments/218036161","html_url":"https://github.com/sourcegraph/appdash/pull/162#issuecomment-218036161","issue_url":"https://api.github.com/repos/sourcegraph/appdash/issues/162","id":218036161,"user":{"login":"slimsag","id":3173176,"avatar_url":"https://avatars.githubusercontent.com/u/3173176?v=3","gravatar_id":"","url":"https://api.github.com/users/slimsag","html_url":"https://github.com/slimsag","followers_url":"https://api.github.com/users/slimsag/followers","following_url":"https://api.github.com/users/slimsag/following{/other_user}","gists_url":"https://api.github.com/users/slimsag/gists{/gist_id}","starred_url":"https://api.github.com/users/slimsag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimsag/subscriptions","organizations_url":"https://api.github.com/users/slimsag/orgs","repos_url":"https://api.github.com/users/slimsag/repos","events_url":"https://api.github.com/users/slimsag/events{/privacy}","received_events_url":"https://api.github.com/users/slimsag/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T01:28:39Z","updated_at":"2016-05-10T01:28:39Z","body":"> If base is nil, could we not resort to previous behaviour? This is just a suggestion to simplify the API usage. But if you want to force people to think of the base url, then this is good.\r\n\r\nAt an initial glance this would seem like a simplification, but it's actually a bad idea in disguise. It's actually very important that users specify the right base URL otherwise some things will break (e.g. trace permalinks, certain JS/CSS/etc file includes, etc) and others won't. It's not pretty, and worse might not always be obvious in the future, so best to force the user to think about what exactly that parameter really means."}}