mirror of
https://github.com/owncast/owncast.git
synced 2024-12-18 15:23:55 +03:00
fix(api): return http 405 if federation is diabled
This commit is contained in:
parent
7ca17eae84
commit
545b9983f7
1 changed files with 6 additions and 0 deletions
|
@ -284,6 +284,12 @@ func writeResponse(payload interface{}, w http.ResponseWriter) error {
|
||||||
|
|
||||||
// HostMetaController points to webfinger.
|
// HostMetaController points to webfinger.
|
||||||
func HostMetaController(w http.ResponseWriter, r *http.Request) {
|
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()
|
serverURL := data.GetServerURL()
|
||||||
if serverURL == "" {
|
if serverURL == "" {
|
||||||
w.WriteHeader(http.StatusNotFound)
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
|
Loading…
Reference in a new issue