Don't send HEAD to FTP servers behind HTTP proxies. Bug 148813,

r=bbaetz, sr=darin
This commit is contained in:
bzbarsky%mit.edu 2002-06-17 20:49:42 +00:00
Родитель cd8a2cf2eb
Коммит 03ac464839
1 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -118,8 +118,21 @@ nsURIChecker::AsyncCheckURI(const nsACString &aURI,
// See if it's an http channel, which needs special treatment:
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel);
if (httpChannel)
httpChannel->SetRequestMethod(NS_LITERAL_CSTRING("HEAD"));
if (httpChannel) {
// We can have an HTTP channel that has a non-HTTP URL if
// we're doing FTP via an HTTP proxy, for example. See for
// example bug 148813
nsCOMPtr<nsIURI> channelURI;
mChannel->GetURI(getter_AddRefs(channelURI));
if (channelURI) {
PRBool isReallyHTTP = PR_FALSE;
channelURI->SchemeIs("http", &isReallyHTTP);
if (!isReallyHTTP)
channelURI->SchemeIs("https", &isReallyHTTP);
if (isReallyHTTP)
httpChannel->SetRequestMethod(NS_LITERAL_CSTRING("HEAD"));
}
}
// Hook us up to listen to redirects and the like
mChannel->SetNotificationCallbacks(this);