Update deps

This commit is contained in:
Jeff Mitchell
2017-01-26 20:16:19 -05:00
parent 2498b6dfc7
commit 15993a9934
135 changed files with 3292 additions and 34966 deletions

View File

@@ -85,9 +85,6 @@ const (
// https://developer.github.com/changes/2016-07-06-github-pages-preiew-api/
mediaTypePagesPreview = "application/vnd.github.mister-fantastic-preview+json"
// https://developer.github.com/v3/repos/traffic/
mediaTypeTrafficPreview = "application/vnd.github.spiderman-preview+json"
// https://developer.github.com/changes/2016-09-14-projects-api/
mediaTypeProjectsPreview = "application/vnd.github.inertia-preview+json"
@@ -409,6 +406,12 @@ func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) {
resp, err := c.client.Do(req)
if err != nil {
if e, ok := err.(*url.Error); ok {
if url, err := url.Parse(e.URL); err == nil {
e.URL = sanitizeURL(url).String()
return nil, e
}
}
return nil, err
}
@@ -553,7 +556,7 @@ func (r *AbuseRateLimitError) Error() string {
}
// sanitizeURL redacts the client_secret parameter from the URL which may be
// exposed to the user, specifically in the ErrorResponse error message.
// exposed to the user.
func sanitizeURL(uri *url.URL) *url.URL {
if uri == nil {
return nil