]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1758: HEAD on ftp:// URLs always returned 200 OK.
authorhno <>
Tue, 19 Sep 2006 05:13:21 +0000 (05:13 +0000)
committerhno <>
Tue, 19 Sep 2006 05:13:21 +0000 (05:13 +0000)
The FTP gateway took a little to narrow shortcut when processing HEAD
requests, not even verifying that the file esists (only directory).

src/ftp.cc

index 61ff9e49cb5d1454c3eef1b979663d37e7df72be..1b924f183801e94f721520318dece639abcd083a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.404 2006/09/10 01:53:00 adrian Exp $
+ * $Id: ftp.cc,v 1.405 2006/09/18 23:13:21 hno Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -2178,7 +2178,7 @@ ftpSendPasv(FtpStateData * ftpState)
 
     debugs(9, 3, HERE << "ftpSendPasv started");
 
-    if (ftpState->request->method == METHOD_HEAD) {
+    if (ftpState->request->method == METHOD_HEAD && (ftpState->flags.isdir || ftpState->size != -1)) {
         /* Terminate here for HEAD requests */
         ftpState->appendSuccessHeader();
         storeTimestampsSet(ftpState->entry);