Skip to content

Commit

Permalink
Improving fake proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Truiteseche committed Feb 29, 2024
1 parent 701efe7 commit 4edfb80
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ function isWeekdayAndBusinessHours() {

export function getProxiedURL(url, bait = false) {
const proxyURL = "https://raspi.ecole-directe.plus:3000/proxy?url=";
if (!bait || (isWeekdayAndBusinessHours() && location.hostname !== "ecole-directe.plus")) {
const fakeProxy = "https://ecole-directe.plus:8000/proxy?url=";
if (!bait) {
return proxyURL + encodeURIComponent(url);
} else {
return url;
if (isWeekdayAndBusinessHours() && location.hostname === "ecole-directe.plus") {
return fakeProxy + encodeURIComponent(url)
} else {
return url;
}
}
}

0 comments on commit 4edfb80

Please sign in to comment.