~gjabell/binit

1fb1db7718c1c173ae91137e71ad88ab0701fb7b — Galen Abell 2 years ago c59fb66
Fix 404 errors after file ending change
1 files changed, 0 insertions(+), 6 deletions(-)

M server.go
M server.go => server.go +0 -6
@@ 61,12 61,6 @@ func (s *Server) get(w http.ResponseWriter, r *http.Request) {
	// so joining it to the base upload path should produce a path that is always
	// a subpath of the upload directory.
	path := strings.Trim(r.URL.Path, "/")
	if len(path) != uniuri.StdLen {
		// We generate consistent-length identifiers, so if the path isn't that
		// length then we know it doesn't exist.
		http.Error(w, "404 page not found", http.StatusNotFound)
		return
	}
	path = filepath.Join(s.config.UploadDir, filepath.Clean(path))

	http.ServeFile(w, r, path)