title: jQuery.GET intermittent failure in Safari in ipad
body: <p>I have the following utility function which I use as a standard way of adding headers to an HTTP GET request.</p>
  <pre class="lang-js prettyprint-override"><code>const get1 = function(url, callback) {
      console.log(&quot;in get1 with url : &quot; + url);
  
      return new Promise(function(resolve, reject) {
          firebase.auth().currentUser.getIdToken()
              .then(function(idToken) {
                  return {
                      'Authorization': 'Bearer ' + idToken,
                      'ACTING_ON_BEHALF_OF': ns.actingAs
                  };
              })
              .then(function(headers) {
                  resolve($.get({
                      url: url,
                      headers: headers,
                      dataType: &quot;json&quot;,
                      error: function(jqXHR, textStatus, errorThrown) {
                          alert(textStatus);
                          alert(errorThrown);
                          alert(jqXHR.responseText);
                      }
                  }));
              });
      });
  };
  </code></pre>
  <p>I call it with structures similar to this</p>
  <pre class="lang-js prettyprint-override"><code>const targetUrl = ns.operation + &quot;/&quot; + ns.stage + &quot;/&quot; + ns.category;
  
  utils.get1(&quot;/api/gameconfig/v1/oddoneout/&quot; + targetUrl)
      .then(function(data) {
              console.log(&quot;THEN Block&quot;)
              // blah blah blah
      });
  </code></pre>
  <p>This seems to work reliably in all browsers except Safari on iPad where, periodically, the GET request appears to be executed but the <code>.then</code> block never gets entered.</p>
  <p>Debugging the javascript seems to indicate that the HTTP request is still executing, but the server side seems to think that it has successfully completed the request and returned a response.</p>
  <p>I'm at a loss as to why I see this behaviour. There doesn't seem any pattern to it. Sometimes I can make 50 calls without a problem, sometimes it fails more or less immediately.</p>
  <p>Any help will be gratefully received - even if it's hints about how to debug this.</p>
  <p>I'm using jQuery 3.3.1 if that makes any difference.</p>