react-open-source-grid 1.3.9 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/404.html CHANGED
@@ -4,16 +4,17 @@
4
4
  <meta charset="utf-8">
5
5
  <title>Redirecting...</title>
6
6
  <script>
7
- // Only redirect if not already at index.html or root
8
- var path = window.location.pathname;
9
- var isRoot = path === '/' || path.endsWith('/index.html');
10
- if (!isRoot) {
11
- // Redirect to root, preserving path, query, and hash for React Router
12
- var search = window.location.search;
13
- var hash = window.location.hash;
14
- var redirectUrl = '/' + path.replace(/^\//, '') + search + hash;
15
- window.location.replace(redirectUrl);
16
- }
7
+ (function () {
8
+ var l = window.location;
9
+ // If we already came through the redirect, don't loop
10
+ if (l.search.indexOf('from404=1') !== -1) {
11
+ return;
12
+ }
13
+ var path = l.pathname + l.search + l.hash;
14
+ // Always go to root, encoding the original path
15
+ var redirectUrl = '/?from404=1&path=' + encodeURIComponent(path);
16
+ l.replace(redirectUrl);
17
+ })();
17
18
  </script>
18
19
  </head>
19
20
  <body>