Indefero

Indefero Commit Details


Date:2011-07-24 15:12:36 (13 years 4 months ago)
Author:Patrick Georgi
Branch:develop, feature.content-md5, feature.diff-whitespace, feature.issue-of-others, feature.search-filter, feature.webrepos, feature.wiki-default-page, release-1.2, release-1.3
Commit:945429abf0fea2f7bb0ab0171389fb7aa593cd87
Parents: a016bcb51baec547c69a6b13217eb29e6e77e087
Message:Provide MD5 value of downloads to HTTP client

Content-MD5 is a HTTP header to provide end-to-end integrity checks
(see RFC2616, 14.15). This doesn't protect against malicious
modifications, but against transmissions errors and storage errors
on the server.

The change also removes one redirect when downloading files.
Changes:

File differences

src/IDF/Upload.php
150150
151151
152152
153
153
154154
155155
156156
......
167167
168168
169169
170
171
172
173
174
170175
171176
172177
......
256261
257262
258263
259
264
if ($this->id == '') {
$this->creation_dtime = gmdate('Y-m-d H:i:s');
$this->modif_dtime = gmdate('Y-m-d H:i:s');
$this->md5 = md5_file (Pluf::f('upload_path') . '/' . $this->get_project()->shortname . '/files/' . $this->file);
$this->md5 = md5_file ($this->getFullPath());
}
}
return Pluf::f('url_upload').'/'.$project->shortname.'/files/'.$this->file;
}
function getFullPath()
{
return(Pluf::f('upload_path').'/'.$this->get_project()->shortname.'/files/'.$this->file);
}
/**
* We drop the information from the timeline.
*/
}
Pluf_Translation::loadSetLocale($current_locale);
}
}
}
src/IDF/Views/Download.php
202202
203203
204204
205
205
206
207
208
209
206210
207211
208212
$prj->inOr404($upload);
$upload->downloads += 1;
$upload->update();
return new Pluf_HTTP_Response_Redirect($upload->getAbsoluteUrl($prj));
$path = $upload->getFullPath();
$mime = IDF_FileUtil::getMimeType($path);
$render = new Pluf_HTTP_Response_File($path, $mime[0]);
$render->headers["Content-MD5"] = $upload->md5;
return $render;
}
/**

Archive Download the corresponding diff file

Page rendered in 0.08351s using 13 queries.