thm / uinames

A simple tool to generate names for use in designs and mockups.
https://uinames.com
Other
755 stars 205 forks source link

Unhandled cors random behavior #134

Open zeroidentidad opened 5 years ago

zeroidentidad commented 5 years ago

Sometimes http request get status failed. Then I change to https captura

As above, now https request get status failed. Then I change to http captura_1

I tested setting url radomly in request as follow

let urls = [
    "http://uinames.com/api/?",
    "https://uinames.com/api/?"
];
let url = urls[Math.floor(Math.random() * urls.length)];
if (cantidad !== '') {
    url += `amount=${cantidad}&`;
}

Getting captura_2