🧱 Chunk is a download manager for slow and unstable servers

Query strings become part of the downloaded filename #10

Open cuducos.me
Open opened by cuducos.me

Problem

prepareAndStartDownload runs filepath.Base on the raw URL string (downloader.go:321), so anything after the last / — including the query string — becomes the filename.

Impact

/report.pdf?token=abc123 is saved as report.pdf?token=abc123, which is not a valid filename on Windows and leaks tokens into local filenames.

Reproduction (verified)

Downloading /report.pdf?token=abc123 creates a file literally named report.pdf?token=abc123.

Suggested fix

Parse the URL with url.Parse and use u.Path.

Sign up or Sign in to add to the discussion.