blog style improvements; fix connection pool drain
This commit is contained in:
parent
0a75216aaf
commit
1d98a6fdca
8 changed files with 51 additions and 24 deletions
|
|
@ -11,7 +11,7 @@ import (
|
|||
|
||||
const BSKY_API_BASE = "https://public.api.bsky.app"
|
||||
|
||||
func FetchThreadViewPost(actorID string, recordID string) (*model.ThreadViewPost, error) {
|
||||
func FetchThreadViewPost(app *model.AppState, actorID string, recordID string) (*model.ThreadViewPost, error) {
|
||||
uri := fmt.Sprintf("at://%s/app.bsky.feed.post/%s", actorID, recordID)
|
||||
|
||||
req, err := http.NewRequest(
|
||||
|
|
@ -24,7 +24,7 @@ func FetchThreadViewPost(actorID string, recordID string) (*model.ThreadViewPost
|
|||
req.URL.RawQuery = url.Values{
|
||||
"uri": { uri },
|
||||
}.Encode()
|
||||
req.Header.Set("User-Agent", "ari melody [https://arimelody.me]")
|
||||
req.Header.Set("User-Agent", fmt.Sprintf("ari melody [%s]", app.Config.BaseUrl))
|
||||
req.Header.Set("Accept", "application/json")
|
||||
|
||||
client := &http.Client{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue