Closing response body when fetching link previews (#5181)

Этот коммит содержится в:
Christopher Speller
2017-01-24 20:02:41 -05:00
коммит произвёл GitHub
родитель 3234f98aec
Коммит 27f76afb28
3 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@@ -8,7 +8,6 @@ import (
"crypto/sha1"
"crypto/tls"
"encoding/base64"
"io/ioutil"
"net/http"
"strconv"
"strings"
@@ -108,10 +107,3 @@ func generateTurnPassword(username string, secret string) string {
h.Write([]byte(username))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
func closeBody(r *http.Response) {
if r.Body != nil {
ioutil.ReadAll(r.Body)
r.Body.Close()
}
}