提交 8030c3b6 编写于 作者: M Mislav Marohnić

Stop requesting `thor-preview` in API requests

It wasn't necessary for github.com since December 2017.
上级 adcfd980
......@@ -855,7 +855,6 @@ Feature: hub pull-request
json :html_url => "the://url", :number => 1234
}
post('/repos/mislav/coral/pulls/1234/requested_reviewers') {
halt 415 unless request.accept?('application/vnd.github.thor-preview+json')
assert :reviewers => ["mislav", "josh", "pcorpet"]
assert :team_reviewers => ["robots", "js"]
status 201
......@@ -877,7 +876,6 @@ Feature: hub pull-request
:requested_teams => [{ :name => "robots" }]
}
post('/repos/mislav/coral/pulls/1234/requested_reviewers') {
halt 415 unless request.accept?('application/vnd.github.thor-preview+json')
assert :reviewers => ["mislav", "pcorpet"]
assert :team_reviewers => ["js"]
status 201
......
......@@ -138,7 +138,7 @@ func (client *Client) RequestReview(project *Project, prNumber int, params map[s
return
}
res, err := api.PostReview(fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", project.Owner, project.Name, prNumber), params)
res, err := api.PostJSON(fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", project.Owner, project.Name, prNumber), params)
if err = checkStatus(201, "requesting reviewer", res, err); err != nil {
return
}
......
......@@ -279,12 +279,6 @@ func (c *simpleClient) PatchJSON(path string, payload interface{}) (*simpleRespo
return c.jsonRequest("PATCH", path, payload, nil)
}
func (c *simpleClient) PostReview(path string, payload interface{}) (*simpleResponse, error) {
return c.jsonRequest("POST", path, payload, func(req *http.Request) {
req.Header.Set("Accept", "application/vnd.github.thor-preview+json;charset=utf-8")
})
}
func (c *simpleClient) PostFile(path, filename string) (*simpleResponse, error) {
stat, err := os.Stat(filename)
if err != nil {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册