Skip to content

Commit

Permalink
don't send filename to server
Browse files Browse the repository at this point in the history
It is not used since we always randomize the filename and not escaping
it causes problems anyway.
  • Loading branch information
mutantmonkey committed Oct 16, 2015
1 parent 758a109 commit 2728673
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions linx.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,13 @@ func linx(config *Config, filepath string, ttl int, deleteKey string) {
}

filename := path.Base(filepath)
uploadUrl := fmt.Sprintf("%supload/%s", config.Server, filename)
stat, err := f.Stat()
if err != nil {
log.Fatalf("Failed to stat file: %v\n", err)
}
reader := progress.NewProgressReader(filename, bufio.NewReader(f), stat.Size())

req, err := http.NewRequest("PUT", uploadUrl, reader)
req, err := http.NewRequest("PUT", config.Server + "/upload", reader)
if err != nil {
log.Fatalf("Failed to create request: %v\n", err)
}
Expand Down

0 comments on commit 2728673

Please sign in to comment.