Merge pull request #4 from mattermost/mm-1245

fixes mm-1245 filenames are now url escaped
Этот коммит содержится в:
Corey Hulen
2015-06-15 10:02:11 -08:00
родитель 4335b21ee9 706bba193d
Коммит c7bdb8acdb
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@@ -114,7 +114,7 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
fileUrl := c.TeamUrl + "/api/v1/files/get/" + channelId + "/" + c.Session.UserId + "/" + uid + "/" + files[i].Filename
fileUrl := c.TeamUrl + "/api/v1/files/get/" + channelId + "/" + c.Session.UserId + "/" + uid + "/" + url.QueryEscape(files[i].Filename)
resStruct.Filenames = append(resStruct.Filenames, fileUrl)
}

Просмотреть файл

@@ -165,7 +165,7 @@ module.exports = React.createClass({
<span className="text"> | </span>
</div>
: "" }
<a href={this.props.filenames[id]} download={name} className="text">Download</a>
<a href={this.props.filenames[id]} download={decodeURIComponent(name)} className="text">Download</a>
</div>
</div>
{loading}