Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

fix(api): return http 405 if federation is diabled

Gabe Kangasfcd7822dd253
diff --git a/activitypub/controllers/nodeinfo.go b/activitypub/controllers/nodeinfo.go
index aeb9832dda..ddddf4def3 100644
--- a/activitypub/controllers/nodeinfo.go
+++ b/activitypub/controllers/nodeinfo.go
@@ -284,6 +284,12 @@ func writeResponse(payload interface{}, w http.ResponseWriter) error {
// HostMetaController points to webfinger.
func HostMetaController(w http.ResponseWriter, r *http.Request) {
+ if !data.GetFederationEnabled() {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ log.Debugln("host meta request rejected! Federation is not enabled")
+ return
+ }
+
serverURL := data.GetServerURL()
if serverURL == "" {
w.WriteHeader(http.StatusNotFound)