this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support rlbypass for handle resolution (#297)

Use the `rlbypass` header for handle resolution when resolving against
`.bsky.social` handles.

authored by

Jaz and committed by
GitHub
2fcb59a1 7ede4c35

+13 -1
+13 -1
cmd/bigsky/main.go
··· 6 6 "os" 7 7 "os/signal" 8 8 "path/filepath" 9 + "strings" 9 10 "syscall" 10 11 "time" 11 12 ··· 24 25 "github.com/bluesky-social/indigo/xrpc" 25 26 _ "go.uber.org/automaxprocs" 26 27 28 + "net/http" 27 29 _ "net/http/pprof" 28 30 29 31 _ "github.com/joho/godotenv/autoload" ··· 295 297 blobstore = &blobs.DiskBlobStore{bsdir} 296 298 } 297 299 298 - var hr api.HandleResolver = &api.ProdHandleResolver{} 300 + prodHR := api.ProdHandleResolver{} 301 + if rlskip != "" { 302 + prodHR.ReqMod = func(req *http.Request, host string) error { 303 + if strings.HasSuffix(host, ".bsky.social") { 304 + req.Header.Set("x-ratelimit-bypass", rlskip) 305 + } 306 + return nil 307 + } 308 + } 309 + 310 + var hr api.HandleResolver = &prodHR 299 311 if cctx.StringSlice("handle-resolver-hosts") != nil { 300 312 hr = &api.TestHandleResolver{ 301 313 TrialHosts: cctx.StringSlice("handle-resolver-hosts"),