PolyGerrit: Bug fix for iOS 10.3 and mac 10.12.4 https://bugs.webkit.org/show_bug.cgi?id=169970 There seems to be a bug in iOS 10.3 that if the header is undefined everything fails. That's fixed in safari 10.2 which is not in safari 10.1 on iOS 10.3. We can revert this when the fix makes it into iOS 10.3. Bug: Issue 5715 Change-Id: I7c027b5bf90c67d15541188120b202aa965cf1d5 (cherry picked from commit 37140336228faaa6ff13892954bbbd425fed8a08)
diff --git a/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js b/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js index cad9bc3..b0bc9bf 100644 --- a/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js +++ b/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js
@@ -114,10 +114,14 @@ fetchJSON: function(url, opt_errFn, opt_cancelCondition, opt_params, opt_opts) { opt_opts = opt_opts || {}; + // Issue 5715, This can be reverted back once + // iOS 10.3 and mac os 10.12.4 has the fetch api fix. var fetchOptions = { - credentials: 'same-origin', - headers: opt_opts.headers, + credentials: 'same-origin' }; + if (opt_opts.headers !== undefined) { + fetchOptions['headers'] = opt_opts.headers; + } var urlWithParams = this._urlWithParams(url, opt_params); return fetch(urlWithParams, fetchOptions).then(function(response) {