Bug 1495363 - Abort the previous request, if a form is submitted twice, r=nike

This commit is contained in:
Andrea Marchesini 2019-01-16 22:50:41 +01:00
Родитель 2f54dc921b
Коммит 906cc6d446
1 изменённых файлов: 6 добавлений и 7 удалений

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

@ -393,13 +393,12 @@ nsDocLoader::OnStartRequest(nsIRequest* request, nsISupports* aCtxt) {
//
if (mIsLoadingDocument) {
if (loadFlags & nsIChannel::LOAD_DOCUMENT_URI) {
//
// Make sure that the document channel is null at this point...
// (unless its been redirected)
//
NS_ASSERTION(
(loadFlags & nsIChannel::LOAD_REPLACE) || !(mDocumentRequest.get()),
"Overwriting an existing document channel!");
// If we have a document request channel, and this is not a redirect, we
// must abort it and replace it with the new one.
if (!(loadFlags & nsIChannel::LOAD_REPLACE) && mDocumentRequest) {
mDocumentRequest->Cancel(NS_ERROR_ABORT);
mDocumentRequest = nullptr;
}
// This request is associated with the entire document...
mDocumentRequest = request;