javascript Fetch() does not seem to be fully working to reroute browser
Categories
(Core :: DOM: Networking, defect, P3)
Tracking
()
People
(Reporter: ecpantalone, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:83.0) Gecko/20100101 Firefox/83.0
Steps to reproduce:
javascript Fetch() does not seem to be fully working, specifically
fetch(${window.origin}/changes_confirmed
, {
method: "POST",
credentials: "include",
body: JSON.stringify(output_rows),
cache: "no-cache",
headers: new Headers({
"content-type": "application/json"
})
})
.then(function(response) {
if (response.status !== 200) {
console.log(Looks like there was a problem. Status code: ${response.status}
);
return;
}
response.json().then(function(data) {
console.log(data);
window.location.replace(data['url']); <-------- this never happens, though it works on Safari and Chrome. the 'url' is provided within the python def()
});
})
.catch(function(error) {
console.log("Fetch error: " + error);
});
where the url is replaced with a specified url on the backend. This is in a flask app that I've been working on. It works in Chrome and Safari, but Firefox.
Actual results:
The page does not reroute.
Expected results:
The page should reroute to the specified url on the python backend.
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•4 years ago
|
Comment 2•4 years ago
|
||
Hi Reporter,
Could you try to provide us a minimal test case to reproduce this?
Thanks.
Updated•3 years ago
|
Description
•