mirror of
				https://github.com/owncast/owncast.git
				synced 2025-11-01 02:44:31 +08:00 
			
		
		
		
	Support server-rendered index.html for all clients. Closes #1871
This commit is contained in:
		| @ -15,7 +15,6 @@ import ( | ||||
| 	"strings" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/mssola/user_agent" | ||||
| 	log "github.com/sirupsen/logrus" | ||||
| 	"github.com/yuin/goldmark" | ||||
| 	"github.com/yuin/goldmark/extension" | ||||
| @ -98,34 +97,6 @@ func moveFallback(source, destination string) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // IsUserAgentABot returns if a web client user-agent is seen as a bot. | ||||
| func IsUserAgentABot(userAgent string) bool { | ||||
| 	if userAgent == "" { | ||||
| 		return false | ||||
| 	} | ||||
|  | ||||
| 	botStrings := []string{ | ||||
| 		"mastodon", | ||||
| 		"pleroma", | ||||
| 		"applebot", | ||||
| 		"whatsapp", | ||||
| 		"matrix", | ||||
| 		"synapse", | ||||
| 		"element", | ||||
| 		"rocket.chat", | ||||
| 		"duckduckbot", | ||||
| 	} | ||||
|  | ||||
| 	for _, botString := range botStrings { | ||||
| 		if strings.Contains(strings.ToLower(userAgent), botString) { | ||||
| 			return true | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	ua := user_agent.New(userAgent) | ||||
| 	return ua.Bot() | ||||
| } | ||||
|  | ||||
| // IsUserAgentAPlayer returns if a web client user-agent is seen as a media player. | ||||
| func IsUserAgentAPlayer(userAgent string) bool { | ||||
| 	if userAgent == "" { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Gabe Kangas
					Gabe Kangas