Use static servers for serving embedded web assets
This commit is contained in:
@@ -4,23 +4,10 @@ import (
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/owncast/owncast/models"
|
||||
"github.com/owncast/owncast/router/middleware"
|
||||
"github.com/owncast/owncast/utils"
|
||||
)
|
||||
|
||||
// MetadataPage represents a server-rendered web page for bots and web scrapers.
|
||||
type MetadataPage struct {
|
||||
RequestedURL string
|
||||
Image string
|
||||
Thumbnail string
|
||||
TagsString string
|
||||
Summary string
|
||||
Name string
|
||||
Tags []string
|
||||
SocialHandles []models.SocialHandle
|
||||
}
|
||||
|
||||
// IndexHandler handles the default index route.
|
||||
func IndexHandler(w http.ResponseWriter, r *http.Request) {
|
||||
middleware.EnableCors(w)
|
||||
@@ -32,19 +19,6 @@ func IndexHandler(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// If the ETags match then return a StatusNotModified
|
||||
// if responseCode := middleware.ProcessEtags(w, r); responseCode != 0 {
|
||||
// w.WriteHeader(responseCode)
|
||||
// return
|
||||
// }
|
||||
|
||||
// If this is a directory listing request then return a 404
|
||||
// info, err := os.Stat(path.Join(config.WebRoot, r.URL.Path))
|
||||
// if err != nil || (info.IsDir() && !isIndexRequest) {
|
||||
// w.WriteHeader(http.StatusNotFound)
|
||||
// return
|
||||
// }
|
||||
|
||||
// Set a cache control max-age header
|
||||
middleware.SetCachingHeaders(w, r)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user