tus / tusd

Reference server implementation in Go of tus: the open protocol for resumable file uploads
https://tus.github.io/tusd
MIT License
3.03k stars 474 forks source link

Base Path of / no longer working #387

Closed seanfisher closed 4 years ago

seanfisher commented 4 years ago

Describe the bug I updated from an older version of tusd (somewhere in the 0.13s, I think) to the latest version (v1.2.0). Having a base path of / no longer works, it just returns 404 errors. If I set base-path to anything else (/files/ or /resumable/) then it works. Just not a base-path of /.

To Reproduce Steps to reproduce the behavior:

  1. Run docker run --rm --name tusd -p 127.0.0.1:1080:1080 tusproject/tusd:v1.2.0 -port 1080 -max-size 10737418240 -base-path /
  2. Use uppy on the client side to try to upload with configuration:
Uppy({autoProceed: true})
      .use(Tus, { endpoint: 'http://127.0.0.1:1080/' });
  1. Upload fails.

Error message in browser:

[Uppy] [01:29:53] Failed to upload myFile.csv tus: unexpected response while creating upload, originated from request (response code: 404, response text: 404 page not found

Logging from tusd console:

[tusd] 2020/05/25 06:27:47 Using '/srv/tusd-data/data' as directory storage. [tusd] 2020/05/25 06:27:47 Using 10240.00MB as maximum size. [tusd] 2020/05/25 06:27:47 Using 0.0.0.0:1080 as address to listen. [tusd] 2020/05/25 06:27:47 Using / as the base path. [tusd] 2020/05/25 06:27:47 Using /metrics as the metrics path. [tusd] 2020/05/25 06:27:47 Supported tus extensions: creation,creation-with-upload,termination,concatenation,creation-defer-length [tusd] 2020/05/25 06:27:47 You can now upload files to: http://0.0.0.0:1080/ [tusd] 2020/05/25 06:27:49 event="RequestIncoming" method="POST" path="/" requestId=""

HTTP Response body from tusd:

404 page not found

HTTP Response headers from tusd:

Access-Control-Allow-Origin: http://localhost:8000 Access-Control-Expose-Headers: Upload-Offset, Location, Upload-Length, Tus-Version, Tus-Resumable, Tus-Max-Size, Tus-Extension, Upload-Metadata, Upload-Defer-Length, Upload-Concat Content-Length: 19 Content-Type: text/plain; charset=utf-8 Date: Mon, 25 May 2020 06:31:47 GMT Tus-Resumable: 1.0.0 X-Content-Type-Options: nosniff

Expected behavior Upload is successful.

Setup details Please provide following details, if applicable to your situation:

Acconut commented 4 years ago

Thanks for your detailed report. This should be fixed in the 1.3.0 release.

seanfisher commented 4 years ago

Can confirm that fixed it. Thanks for the incredibly quick response and release!