updates...

Former-commit-id: 2d19655aac80ec7033829b0b3d708bf86986252c [formerly b8bb006bd1a5492960c1d4793e15e80775ddc5fd] [formerly 4641277c14953bdb2ddab89ba866cf63f3dac0f9 [formerly 95b91a64a3c648e1414c7feb4b597bf0da195664]]
Former-commit-id: 5a6e07758bbe67fd202effa5b2975c65227eaebd [formerly 9a161548d270750b8da949189ad6f3b641779bfc]
Former-commit-id: 84e0bbcbbead53c5e91987574d5c854a9792515f
This commit is contained in:
Henrique Dias
2017-06-28 11:45:41 +01:00
parent 826d491ff1
commit 0a65393527
1893 changed files with 492634 additions and 10336 deletions

View File

@@ -8,7 +8,7 @@ import (
)
// assetsURL is the url where static assets are served.
const assetsURL = "/_internal"
const assetsURL = "/_"
// requestContext contains the needed information to make handlers work.
type requestContext struct {
@@ -34,9 +34,11 @@ func serveHTTP(c *requestContext, w http.ResponseWriter, r *http.Request) (int,
// Checks if the URL matches the Assets URL. Returns the asset if the
// method is GET and Status Forbidden otherwise.
if matchURL(r.URL.Path, assetsURL) {
if matchURL(r.URL.Path, assetsURL+"/") {
if r.Method == http.MethodGet {
return serveAssets(c, w, r)
r.URL.Path = strings.TrimPrefix(r.URL.Path, assetsURL)
c.fm.static.ServeHTTP(w, r)
return 0, nil
}
return http.StatusForbidden, nil