Bug 1468830 ignore exceptions when retreiving response headers, r=rpl
authorShane Caraveo <scaraveo@mozilla.com>
Thu, 14 Jun 2018 12:42:52 -0700
changeset 422588 e05d3484f97acb89c5e1b65b0737cd1418cac401
parent 422587 928ea511d72b187070bc1ca02cc80d799c318634
child 422589 f7a132050e9608f3ebbb1b45123a1847084d2940
push id65195
push usermixedpuppy@gmail.com
push dateThu, 14 Jun 2018 21:59:05 +0000
treeherderautoland@e05d3484f97a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrpl
bugs1468830
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1468830 ignore exceptions when retreiving response headers, r=rpl MozReview-Commit-ID: Dw4X1q15NHv
toolkit/modules/addons/WebRequest.jsm
--- a/toolkit/modules/addons/WebRequest.jsm
+++ b/toolkit/modules/addons/WebRequest.jsm
@@ -752,18 +752,20 @@ HttpObserverManager = {
         }
 
         if (opts.requestHeaders) {
           requestHeaders = requestHeaders || new RequestHeaderChanger(channel);
           data.requestHeaders = requestHeaders.toArray();
         }
 
         if (opts.responseHeaders) {
-          responseHeaders = responseHeaders || new ResponseHeaderChanger(channel);
-          data.responseHeaders = responseHeaders.toArray();
+          try {
+            responseHeaders = responseHeaders || new ResponseHeaderChanger(channel);
+            data.responseHeaders = responseHeaders.toArray();
+          } catch (e) { /* headers may not be available on some redirects */ }
         }
 
         if (opts.requestBody && channel.canModify) {
           requestBody = requestBody || WebRequestUpload.createRequestBody(channel.channel);
           data.requestBody = requestBody;
         }
 
         try {