multiple files

This commit is contained in:
Adam D. Ruppe 2012-04-16 12:36:39 -04:00
parent 64284c3d7c
commit 3e0a280551
1 changed files with 12 additions and 1 deletions

13
cgi.d
View File

@ -365,7 +365,8 @@ class Cgi {
onRequestBodyDataReceived(amountReceived, originalContentLength);
postArray = assumeUnique(pps._post);
files = assumeUnique(pps._files);
filesArray = assumeUnique(pps._files);
files = keepLastOf(filesArray);
post = keepLastOf(postArray);
cleanUpPostDataState();
}
@ -994,6 +995,16 @@ class Cgi {
return assumeUnique(ca);
}
// FIXME duplication
private immutable(UploadedFile[string]) keepLastOf(in UploadedFile[][string] arr) {
UploadedFile[string] ca;
foreach(k, v; arr)
ca[k] = v[$-1];
return assumeUnique(ca);
}
private immutable(string[][string]) getCookieArray() {
auto forTheLoveOfGod = decodeVariables(cookie, "; ");
return assumeUnique(forTheLoveOfGod);