Please can you tell me your opinion about the comitted solution.
...
if u.ResponseTemplate != "" {
r.URL.Path = "/" + u.ResponseTemplate
/*
* Change the POST method to GET that the following Fileserver
* does not complain about the POST method
*/
if r.Method == "POST" {
r.Method = "GET"
}
}
return next.ServeHTTP(w, r)
}
Is that error stuff relevant though, when serving a upload template? A lot of the code in there is pretty irrelevant to your usecase I think. You’re not serving a directory, you don’t have to care about hidden files, index file fallback, URL canonicalization, encoding/precompression, Etag. The only thing left is Content-Type, but http.ServeContent already handles that if the file extension exists on the template filename (i.e. .html).