{"action":"created","issue":{"url":"https://api.github.com/repos/drewolson/testflight/issues/8","labels_url":"https://api.github.com/repos/drewolson/testflight/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/drewolson/testflight/issues/8/comments","events_url":"https://api.github.com/repos/drewolson/testflight/issues/8/events","html_url":"https://github.com/drewolson/testflight/pull/8","id":124795419,"number":8,"title":"modify PerformRequest() to allow arbitrary modifiers","user":{"login":"faide","id":494577,"avatar_url":"https://avatars.githubusercontent.com/u/494577?v=3","gravatar_id":"","url":"https://api.github.com/users/faide","html_url":"https://github.com/faide","followers_url":"https://api.github.com/users/faide/followers","following_url":"https://api.github.com/users/faide/following{/other_user}","gists_url":"https://api.github.com/users/faide/gists{/gist_id}","starred_url":"https://api.github.com/users/faide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faide/subscriptions","organizations_url":"https://api.github.com/users/faide/orgs","repos_url":"https://api.github.com/users/faide/repos","events_url":"https://api.github.com/users/faide/events{/privacy}","received_events_url":"https://api.github.com/users/faide/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-04T16:53:57Z","updated_at":"2016-01-10T20:06:39Z","closed_at":"2016-01-10T20:06:39Z","pull_request":{"url":"https://api.github.com/repos/drewolson/testflight/pulls/8","html_url":"https://github.com/drewolson/testflight/pull/8","diff_url":"https://github.com/drewolson/testflight/pull/8.diff","patch_url":"https://github.com/drewolson/testflight/pull/8.patch"},"body":"Hi there!\r\n\r\nI modified the testflight Requester to be able to register arbitrary modifier functions...\r\n\r\nThis does not change the default usage as the new argument is a variadic, but it enables a new use case like this one:\r\n\r\n```go\r\nimport (\r\n    \"net/http\"\r\n    \"time\"\r\n\r\n   \"github.com/drewolson/testflight\"\r\n)\r\n\r\nfunc addCookie(r *http.Request) error {\r\n        // create a http.Cookie named c\r\n\tc := http.Cookie{\r\n\t\tName:     \"myapp_session_cookie\",\r\n\t\tValue:    \"some_value\",\r\n\t\tExpires: time.Now().AddDate(0, 1, 0),\r\n\t\tMaxAge:   86400,\r\n\t\tSecure:   true,\r\n\t\tHttpOnly: true,\r\n\t}\r\n\tr.AddCookie(&c)\r\n\treturn nil\r\n}\r\n\r\nfunc TestGet(t *testing.T) {\r\n    testflight.WithServer(Handler(), func(r *testflight.Requester) {\r\n        response := r.Get(\"/hello/drew\", addCookie)\r\n\r\n        assert.Equal(t, 200, response.StatusCode)\r\n        assert.Equal(t, \"hello, drew\", response.Body)\r\n    })\r\n}\r\n```\r\n\r\nI have looked at your unit tests and think I could write a test for this functionality if you want. Please tell me if you are interested in this PR so I can invest more time to write the tests if they are needed :)"},"comment":{"url":"https://api.github.com/repos/drewolson/testflight/issues/comments/170387421","html_url":"https://github.com/drewolson/testflight/pull/8#issuecomment-170387421","issue_url":"https://api.github.com/repos/drewolson/testflight/issues/8","id":170387421,"user":{"login":"drewolson","id":3536,"avatar_url":"https://avatars.githubusercontent.com/u/3536?v=3","gravatar_id":"","url":"https://api.github.com/users/drewolson","html_url":"https://github.com/drewolson","followers_url":"https://api.github.com/users/drewolson/followers","following_url":"https://api.github.com/users/drewolson/following{/other_user}","gists_url":"https://api.github.com/users/drewolson/gists{/gist_id}","starred_url":"https://api.github.com/users/drewolson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewolson/subscriptions","organizations_url":"https://api.github.com/users/drewolson/orgs","repos_url":"https://api.github.com/users/drewolson/repos","events_url":"https://api.github.com/users/drewolson/events{/privacy}","received_events_url":"https://api.github.com/users/drewolson/received_events","type":"User","site_admin":false},"created_at":"2016-01-10T20:06:39Z","updated_at":"2016-01-10T20:06:39Z","body":"In thinking this over, I'd prefer that people use `Do` directly and, if you're doing the same thing in many of your tests, write a helper function to handle the duplication. I'm going to close this now, but I appreciate the PR. Thanks!"}}