Add comments

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian 2020-07-22 00:04:24 -04:00
parent d142255dbd
commit cb8d5d19d0
2 changed files with 4 additions and 0 deletions

View File

@ -118,6 +118,9 @@ func newClient(httpClient *http.Client) *Client {
} }
// todo... // todo...
// Some endpoints (notably the ones to get random subreddits/posts) redirect to a
// reddit.com url, which returns a 403 Forbidden for some reason, unless the url's
// host is changed to oauth.reddit.com
httpClient.CheckRedirect = func(req *http.Request, via []*http.Request) error { httpClient.CheckRedirect = func(req *http.Request, via []*http.Request) error {
redirectURL := req.URL.String() redirectURL := req.URL.String()
redirectURL = strings.Replace(redirectURL, "https://www.reddit.com", defaultBaseURL, 1) redirectURL = strings.Replace(redirectURL, "https://www.reddit.com", defaultBaseURL, 1)

View File

@ -100,6 +100,7 @@ func (p *Permalink) UnmarshalJSON(data []byte) error {
return nil return nil
} }
// todo: rename this to thing
type root struct { type root struct {
Kind string `json:"kind,omitempty"` Kind string `json:"kind,omitempty"`
Data interface{} `json:"data,omitempty"` Data interface{} `json:"data,omitempty"`