1

I am trying to implement a tus-file-uploader (tus.io) based on the exmaples provided on their website. Everything works fine until I switch from

http.Handle("/files/", http.StripPrefix("/files/", handler))

to

r.Handle("/files/", http.StripPrefix("/files/", handler))

having declared r like this:

r := mux.NewRouter()

Using the gorilla router makes the tus-server reply with 404 when trying to call the PATCH-Request to upload a file.

Question: In which ways is http-Handle different from r.Handle given in the example above? Maybe it does not serve PATCH-Requests?

Tobias Gassmann
  • 11,399
  • 15
  • 58
  • 92

1 Answers1

1

Solved it:

r.PathPrefix("/files/").Handler(http.StripPrefix("/files/", handler))

is the correct way to implement the tusd-uploader-handler

Tobias Gassmann
  • 11,399
  • 15
  • 58
  • 92