From cb8d5d19d09469825e7ecf1c6b20588d37cce7ae Mon Sep 17 00:00:00 2001 From: Vartan Benohanian Date: Wed, 22 Jul 2020 00:04:24 -0400 Subject: [PATCH] Add comments Signed-off-by: Vartan Benohanian --- reddit.go | 3 +++ things.go | 1 + 2 files changed, 4 insertions(+) diff --git a/reddit.go b/reddit.go index f99a7e2..98e17fe 100644 --- a/reddit.go +++ b/reddit.go @@ -118,6 +118,9 @@ func newClient(httpClient *http.Client) *Client { } // 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 { redirectURL := req.URL.String() redirectURL = strings.Replace(redirectURL, "https://www.reddit.com", defaultBaseURL, 1) diff --git a/things.go b/things.go index 16b70ab..0d34287 100644 --- a/things.go +++ b/things.go @@ -100,6 +100,7 @@ func (p *Permalink) UnmarshalJSON(data []byte) error { return nil } +// todo: rename this to thing type root struct { Kind string `json:"kind,omitempty"` Data interface{} `json:"data,omitempty"`