Why fetch blocked if it get redirect to mixed content

Viewed 2109

Request from HTML page works in following steps:

1) After https:// link was clicked, we get 302 code and get header location to HTTP:// . Browser follows this
2) Server got request from HTTP and set header location to HTTPS://
3) Browser get content from HTTPS://

Yes, this is stupid but I don't have access to the server.

When I try to send request from Firefox console with fetch with settings

mode: 'cors',
credentials: 'include',
redirect: 'follow'

..but error:

TypeError: NetworkError when attempting to fetch resource.

When I set :

mode: 'no-cors',

All redirects work fine but body response is absent.

Seems like mixed content blocked by fetch?

I use two fetch requests (second with https hardcoded) for redirects excluding. Is there a solution in one fetch request?

0 Answers
Related