fix: trim prefix slash

This commit is contained in:
argoyle committed 2024-01-29 09:19:04 +01:00
1 parent 3aa253afcf
commit fddc2dc0b6
2 files changed
+5 -6

No files matched your search

+1 -1
View File
@@ -64,7 +64,7 @@ func (s *Server) HandleHealth(w http.ResponseWriter, _ *http.Request) {
func (s *Server) upload(path string, w http.ResponseWriter, req *http.Request) {
s.logger.Infof("uploading to %s", path)
err := s.store.Store(path, req.Body)
err := s.store.Store(strings.TrimPrefix(path, "/"), req.Body)
if err != nil {
s.logger.WithError(err).Error("error storing object in bucket")
w.WriteHeader(http.StatusInternalServerError)