<html>
<head>
<base href="https://bugs.webkit.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - JavaScript is not correctly connecting to rest api in iOS 10.3 beta"
href="https://bugs.webkit.org/show_bug.cgi?id=169970#c21">Comment # 21</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - JavaScript is not correctly connecting to rest api in iOS 10.3 beta"
href="https://bugs.webkit.org/show_bug.cgi?id=169970">bug 169970</a>
from <span class="vcard"><a class="email" href="mailto:thomasmulhall410@yahoo.com" title="paladox <thomasmulhall410@yahoo.com>"> <span class="fn">paladox</span></a>
</span></b>
<pre>Doing something like
function _urlWithParams(url) {
return url;
}
var urlWithParams = _urlWithParams('<a href="https://gerrit-review.googlesource.com/config/server/version">https://gerrit-review.googlesource.com/config/server/version</a>');
var fetchOptions = {
//headers: '',
credentials: 'same-origin',
mode: 'no-cors',
headers: {'content-type': 'application/json'},
};
fetch(urlWithParams, fetchOptions)
.then(function(response) {
console.error('response', response)
console.error('header', response.headers.get('Content-Type'))
return response.text().then(function(text) {
var result;
try {
result = JSON.parse(text.substring(JSON_PREFIX.length));
} catch (_) {
result = null;
}
console.error('got text', text)
return result;
});
}).catch(function(ex) {
console.error('failed', ex)
})
fails. I may have done it wrong but not sure.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>