Merge pull request #14 from owncloud/fix/static-assets
fix serving static issues
This commit is contained in:
@@ -8,8 +8,12 @@ import (
|
|||||||
|
|
||||||
// Static is a middleware that serves static assets.
|
// Static is a middleware that serves static assets.
|
||||||
func Static(root string, fs http.FileSystem) func(http.Handler) http.Handler {
|
func Static(root string, fs http.FileSystem) func(http.Handler) http.Handler {
|
||||||
|
if !strings.HasSuffix(root, "/") {
|
||||||
|
root = root + "/"
|
||||||
|
}
|
||||||
|
|
||||||
static := http.StripPrefix(
|
static := http.StripPrefix(
|
||||||
root+"/",
|
root,
|
||||||
http.FileServer(
|
http.FileServer(
|
||||||
fs,
|
fs,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user