Bug 1153484 - Fetch should ignore invalid headers, but still process later headers. r=nsm

This commit is contained in:
Ben Kelly
2015-04-23 10:45:00 -04:00
parent 73051ae88b
commit e74a47201e

View File

@@ -20,6 +20,7 @@
#include "nsDataHandler.h"
#include "nsHostObjectProtocolHandler.h"
#include "nsNetUtil.h"
#include "nsPrintfCString.h"
#include "nsStreamUtils.h"
#include "nsStringStream.h"
@@ -629,7 +630,13 @@ public:
{
ErrorResult result;
mResponse->Headers()->Append(aHeader, aValue, result);
return result.ErrorCode();
if (result.Failed()) {
NS_WARNING(nsPrintfCString("Fetch ignoring illegal header - '%s': '%s'",
PromiseFlatCString(aHeader).get(),
PromiseFlatCString(aValue).get()).get());
result.ClearMessage();
}
return NS_OK;
}
};