Preserve uploaded file extensions
This commit is contained in:
@@ -34,7 +34,7 @@ func (h *testLargeFileMediaHandler) Upload(def *types.FileDef, file io.Reader) (
|
||||
data, _ := io.ReadAll(file)
|
||||
h.def = def
|
||||
h.data = string(data)
|
||||
def.Location = "/v0/file/s/" + def.Uid().String() + ".txt"
|
||||
def.Location = "/v0/file/s/" + media.FileURLName(def)
|
||||
def.ETag = "etag"
|
||||
return def.Location, int64(len(data)), nil
|
||||
}
|
||||
@@ -252,7 +252,7 @@ func TestLargeFileReceiveMeetingNoteUploadCreatesNoteFile(t *testing.T) {
|
||||
params["meeting_id"] != "mtg_test" || params["note_file_id"] != "mnote_note-1" {
|
||||
t.Fatalf("unexpected upload params: %#v", params)
|
||||
}
|
||||
if handler.data != "hello notes" || notes.createdFileID != fileID.String() || notes.createdMeetingID != "mtg_test" || notes.createdIdempotencyKey != "upload-meeting-note-1" {
|
||||
if handler.data != "hello notes" || handler.def.OriginalName != "notes.txt" || notes.createdFileID != fileID.String() || notes.createdMeetingID != "mtg_test" || notes.createdIdempotencyKey != "upload-meeting-note-1" {
|
||||
t.Fatalf("unexpected side effects: handler=%#v notes=%#v", handler, notes)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user