Mercurial > hg > ucis.core
comparison Net/HTTP.cs @ 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 | ba8f94212c6e |
children | fba35b87da32 |
comparison
equal
deleted
inserted
replaced
14:fc3eb8e49ea6 | 15:7c1808f28e05 |
---|---|
398 if (flen == 0) continue; | 398 if (flen == 0) continue; |
399 if (flen == -1) flen = 100; | 399 if (flen == -1) flen = 100; |
400 String fname = Encoding.ASCII.GetString(header, 0, flen); | 400 String fname = Encoding.ASCII.GetString(header, 0, flen); |
401 String fsize = Encoding.ASCII.GetString(header, 124, 11); | 401 String fsize = Encoding.ASCII.GetString(header, 124, 11); |
402 int fsizei = Convert.ToInt32(fsize, 8); | 402 int fsizei = Convert.ToInt32(fsize, 8); |
403 if (fname.StartsWith("./")) fname = fname.Length == 2 ? "/" : fname.Substring(2); | |
403 if (reqname1.Equals(fname, StringComparison.OrdinalIgnoreCase) || reqname2.Equals(fname)) { | 404 if (reqname1.Equals(fname, StringComparison.OrdinalIgnoreCase) || reqname2.Equals(fname)) { |
404 context.SendStatus(200); | 405 context.SendStatus(200); |
405 context.SendHeader("Content-Length", fsizei.ToString()); | 406 context.SendHeader("Content-Length", fsizei.ToString()); |
406 String ctype = null; | 407 String ctype = null; |
407 switch (Path.GetExtension(fname).ToLowerInvariant()) { | 408 switch (Path.GetExtension(fname).ToLowerInvariant()) { |