Skip to content

Commit

Permalink
fix: Wrong parameters order
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioabreu committed Jan 10, 2024
1 parent b500664 commit 607f0f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/uploader/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ func (fu *FileUploadHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
filename := req.URL.EscapedPath()[len("/hls"):]
vars := mux.Vars(req)
folder := vars["folder"]
fu.serveHTTPImpl(filename, folder, w, req)
fu.serveHTTPImpl(folder, filename, w, req)
}

func (fu *FileUploadHandler) serveHTTPImpl(folder, filename string, w http.ResponseWriter, req *http.Request) {
log.Printf("uploading file %s to folder %s", filename, folder)

data, err := io.ReadAll(req.Body)
if err != nil {
log.Printf("failed to read request body: %v", err)
Expand Down

0 comments on commit 607f0f1

Please sign in to comment.