check http response for valid range; report an error if not in valid range (bug 129559, r=jfrancis, sr=kin, a=Asa)

This commit is contained in:
brade%netscape.com 2002-03-22 14:35:00 +00:00
Родитель b564f46b7f
Коммит 8b1caa26a0
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -848,8 +848,18 @@ var gEditorOutputProgressListener =
// Get the new docUrl from the "browse location" in case "publish location" was FTP
var urlstring = GetDocUrlFromPublishData(gPublishData);
try {
// check http channel for response: 200 range is ok; other ranges are not
var httpChannel = aRequest.QueryInterface(Components.interfaces.nsIHttpChannel);
var httpResponse = httpChannel.responseStatus;
if (httpResponse < 200 || httpResponse >= 300)
aStatus = httpResponse; // not a real error but enough to pass check below
} catch(e) {}
if (aStatus)
{
// we should cancel the publish transaction here!
// we should provide more meaningful errors (if possible)
var saveDocStr = GetString("Publish");
var failedStr = GetString("PublishFailed");