mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-17 17:38:10 +00:00
Set Response.type to basic on same-origin requests
This commit is contained in:
@@ -3,6 +3,24 @@
|
||||
const promise1 = new Promise((resolve) => {
|
||||
fetch('http://127.0.0.1:9582/xhr/json')
|
||||
.then((res) => {
|
||||
testing.expectEqual('cors', res.type);
|
||||
return res.json()
|
||||
})
|
||||
.then((json) => {
|
||||
resolve(json);
|
||||
});
|
||||
});
|
||||
|
||||
testing.async(promise1, (json) => {
|
||||
testing.expectEqual({over: '9000!!!'}, json);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script id=same-origin type=module>
|
||||
const promise1 = new Promise((resolve) => {
|
||||
fetch('http://localhost:9582/xhr/json')
|
||||
.then((res) => {
|
||||
testing.expectEqual('basic', res.type);
|
||||
return res.json()
|
||||
})
|
||||
.then((json) => {
|
||||
|
||||
@@ -95,7 +95,9 @@
|
||||
async function async(promise, cb) {
|
||||
const script_id = document.currentScript.id;
|
||||
const stack = new Error().stack;
|
||||
this._captured = {script_id: script_id, stack: stack};
|
||||
const value = await promise;
|
||||
// reset it, because await promise could change it.
|
||||
this._captured = {script_id: script_id, stack: stack};
|
||||
cb(value);
|
||||
this._captured = null;
|
||||
|
||||
Reference in New Issue
Block a user