changeset 15:7c1808f28e05

HTTP: Correctly interpret tar file path names in HTTPUnTarchiveProvider
author Ivo Smits <Ivo@UCIS.nl>
date Fri, 15 Mar 2013 00:02:58 +0100
parents fc3eb8e49ea6
children fba35b87da32
files Net/HTTP.cs
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Net/HTTP.cs	Thu Feb 28 02:53:01 2013 +0100
+++ b/Net/HTTP.cs	Fri Mar 15 00:02:58 2013 +0100
@@ -400,6 +400,7 @@
 					String fname = Encoding.ASCII.GetString(header, 0, flen);
 					String fsize = Encoding.ASCII.GetString(header, 124, 11);
 					int fsizei = Convert.ToInt32(fsize, 8);
+					if (fname.StartsWith("./")) fname = fname.Length == 2 ? "/" : fname.Substring(2);
 					if (reqname1.Equals(fname, StringComparison.OrdinalIgnoreCase) || reqname2.Equals(fname)) {
 						context.SendStatus(200);
 						context.SendHeader("Content-Length", fsizei.ToString());