Eilisen palvelinpäivityksen takia viikkotehtävä 2:n edellyttämä palvelinsovellus users.jyu.fi-palvelimella on nyt rikki. En pysty vielä sanomaan milloin se taas toimii, koska joudun odottelemaan digipalvelujen apua.
Hätäapuna voi käyttää tätä osoitetta:
https://appro.mit.jyu.fi/cgi-bin/tiea2120/vt2.cgi/
eli muuttaa rivin:
const response = await fetch('http://users.jyu.fi/~tjlahton/cgi-bin/tiea2120/vt2.cgi/', {"credentials": "include"});
muotoon:
const response = await fetch('https://appro.mit.jyu.fi/cgi-bin/tiea2120/vt2.cgi/', {"credentials": "include"});
mutta lopullisessa sovelluksessa pitää käyttää alkuperäistä osoitetta.
Sovellus ei välttämättä toimi edellä mainitulla osoitteella kunnolla cors- ja mixed content rajoitusten takia. Tämä on enemmän web-palvelinohjelmointikurssin aihepiiriä. Aiheesta voi lukea lisää täältä:
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper....
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper....
xmldatan lataus todennäköisesti toimii, mutta esim. rastin tai joukkueen tallentaminen ei todnäk toimi eli rasti tai joukkue tallentuu kyllä palvelimelle, mutta rajoitusten takia palvelin saattaa unohtaa sen samantien ja tarjota teille seuraavalla sivun latauskerralla uutta tyhjättyä versiota xmldatasta.
Firefoxilla saa erikseen sallittua mixed contentin:
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsupport.mo...
eli klikkaatte osoitepalkissa olevaa lukon kuvaa ja sen alta löytyy kohta "connection secure". Tämän alta löytyy edelleen valinta "disable protection for now", jolla saa skriptien lataamisen sallittua. Tämä on sivustokohtainen asetus eikä ole mitenkään vaarallista sallia mixed contentia.
mixed content tarkoittaa, että samalle sivulle ladataan sisältöä http- ja https-alkuisista osoitteista eli osa tulee suojattua yhteyttä pitkin ja osa ei. Tämä ei oikeasti ole millään tavalla tietoturvariski, jos http-yhteyden kautta ladataan kuvia ym. eikä siirretä mitään autentikointitietoja tai muuta salaista.
On Thu, 3 Oct 2024, Tommi Lahtonen via Tiea2120 wrote:
const response = await fetch('http://users.jyu.fi/~tjlahton/cgi-bin/tiea2120/vt2.cgi/', {"credentials": "include"});
nyt pitäisi taas toimia kuten pitääkin eli voi palauttaa tämän alkuperäisen rivin.