From a7085ac7cde1c6d9284749437dde4e9c3a4afe4a Mon Sep 17 00:00:00 2001 From: hno <> Date: Tue, 19 Sep 2006 05:13:21 +0000 Subject: [PATCH] Bug #1758: HEAD on ftp:// URLs always returned 200 OK. 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ftp.cc b/src/ftp.cc index 61ff9e49cb..1b924f1838 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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); -- 2.47.3