Skip to content

Commit

Permalink
update: add a http redirect to https
Browse files Browse the repository at this point in the history
  • Loading branch information
daluclemas committed Jun 17, 2024
1 parent c4bc696 commit 6465c9c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ function App() {
useEffect(() => {
window.scrollTo(0, 0);
}, [pathname]);

useEffect(() => {
// Check if the current protocol is HTTP
if (process.env.NODE_ENV === "production") {
if (window.location.protocol === "http:") {
// Redirect to the equivalent URL with HTTPS
window.location.href = `https://${window.location.hostname}${window.location.pathname}`;
}
}
}, []);
return (
<QueryClientProvider client={queryClient}>
<Routes>
Expand Down

0 comments on commit 6465c9c

Please sign in to comment.