Fix: Add referer header

This commit is contained in:
Dorian Zedler 2022-10-24 10:07:39 +02:00
parent d2a0c9a2d5
commit bef407ebc3
Signed by: dorian
GPG key ID: 989DE36109AFA354

View file

@ -8,7 +8,7 @@ BRWidget::BRWidgetStatusCode BRProviderVl::getWidgetData(BRCalendar::BRCalendarD
{ {
// load some data // load some data
QString requestUrl = "https://ifsc.results.info/api/v1/"; QString requestUrl = "https://ifsc.results.info/api/v1/";
QVariantMap ret = this->serverRequest(QUrl(requestUrl), {{"x-auth-token", "cc7375f680648e7e6171e035e70351eb"}}); QVariantMap ret = this->serverRequest(QUrl(requestUrl), {{"x-auth-token", "cc7375f680648e7e6171e035e70351eb"}, {"Referer", "https://ifsc.results.info/"}});
if(ret["status"] != 200){ if(ret["status"] != 200){
// request was a failure // request was a failure
@ -83,7 +83,7 @@ BRSeason::BRSeasonData BRProviderVl::parseSeasonData(QVariantMap rawData) {
BRWidget::BRWidgetStatusCode BRProviderVl::getWidgetData(BRLeague::BRLeagueData* leagueData) { BRWidget::BRWidgetStatusCode BRProviderVl::getWidgetData(BRLeague::BRLeagueData* leagueData) {
// load some data // load some data
QString requestUrl = "https://ifsc.results.info/api/v1/season_leagues/" + QString::number(leagueData->league->getId()); QString requestUrl = "https://ifsc.results.info/api/v1/season_leagues/" + QString::number(leagueData->league->getId());
QVariantMap ret = this->serverRequest(QUrl(requestUrl), {{"x-auth-token", "cc7375f680648e7e6171e035e70351eb"}}); QVariantMap ret = this->serverRequest(QUrl(requestUrl), {{"x-auth-token", "cc7375f680648e7e6171e035e70351eb"}, {"Referer", "https://ifsc.results.info/"}});
if(ret["status"] != 200){ if(ret["status"] != 200){
// request was a failure // request was a failure
@ -156,7 +156,7 @@ BRWidget::BRWidgetStatusCode BRProviderVl::getWidgetData(BRCompetition::BRCompet
requestUrl = "https://ifsc.results.info/api/v1/category_rounds/" + roundId + "/results"; requestUrl = "https://ifsc.results.info/api/v1/category_rounds/" + roundId + "/results";
} }
QVariantMap ret = this->serverRequest(QUrl(requestUrl), {{"x-auth-token", "cc7375f680648e7e6171e035e70351eb"}}); QVariantMap ret = this->serverRequest(QUrl(requestUrl), {{"x-auth-token", "cc7375f680648e7e6171e035e70351eb"}, {"Referer", "https://ifsc.results.info/"}});
if(ret["status"] != 200){ if(ret["status"] != 200){
// request was a failure // request was a failure