bluesky-social / indigo

Go source code for Bluesky's atproto services.
https://atproto.com
Apache License 2.0
661 stars 99 forks source link

bug: self-hosting relay raises nil pointer exception on creating account in PDS. #704

Closed itaru2622 closed 2 months ago

itaru2622 commented 2 months ago

the exception is caused by below part (line 363). c.Client is cared nil only when c.Host is *.bsky.network by line 352, but not in else clause(self-hosting relay).

https://github.com/bluesky-social/indigo/blob/7d1235931bd3537c1a1f63ffca73bca4bdd632c2/cmd/bigsky/main.go#L350-L365

c.Client should be created when it is nil regardless c.Host value, as below:

                } else {
+                       if c.Client == nil {
+                               c.Client = util.RobustHTTPClient()
+                       }
                        // Generic PDS timeout
                        c.Client.Timeout = time.Minute * 1