[object Object]

← back to Re Flyer Aggregator

add creds-in-URL fetch guard to gated flyers pages (TK-10984)

3d51e5eb60a330153bb62fc0b2932d7e85261561 · 2026-08-31 00:39:59 -0700 · Steve Abrams

Files touched

Diff

commit 3d51e5eb60a330153bb62fc0b2932d7e85261561
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Aug 31 00:39:59 2026 -0700

    add creds-in-URL fetch guard to gated flyers pages (TK-10984)
---
 public/flyers-found/index.html | 26 +++++++++++++++++++++++++-
 public/flyers/index.html       | 26 +++++++++++++++++++++++++-
 2 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/public/flyers-found/index.html b/public/flyers-found/index.html
index f9506b9..7864dca 100644
--- a/public/flyers-found/index.html
+++ b/public/flyers-found/index.html
@@ -1,4 +1,28 @@
-<!doctype html><html lang="en"><head><meta charset="utf-8">
+<!doctype html><html lang="en"><head>
+<script>
+// Credential-safe fetch guard (fleet drop-in) — if this page is opened with
+// credentials in the URL (a saved bookmark / Chrome-remembered basic-auth:
+// https://user:pass@host/…), the browser poisons document.baseURI, so any
+// relative or root-relative fetch('/api/…') throws "Request cannot be constructed
+// from a URL that includes credentials" and callers silently fall to an empty
+// state. Resolve every non-absolute request URL against the credential-free
+// location instead of baseURI. Placed first so it wraps window.fetch before any
+// app script runs. Ref: creds-in-url-fetch-guard-fleet-pattern.
+(function () {
+  var _fetch = window.fetch.bind(window);
+  var cleanBase = function () { return location.origin + location.pathname; };
+  window.fetch = function (input, init) {
+    try {
+      if (typeof input === 'string' && !/^[a-z]+:\/\//i.test(input) && input.indexOf('//') !== 0) {
+        input = new URL(input, cleanBase()).href;
+      } else if (input instanceof Request && !/^[a-z]+:\/\//i.test(input.url)) {
+        input = new Request(new URL(input.url, cleanBase()).href, input);
+      }
+    } catch (_) { /* fall through to native */ }
+    return _fetch(input, init);
+  };
+})();
+</script><meta charset="utf-8">
 <meta name="viewport" content="width=device-width,initial-scale=1">
 <title>Property Flyers — found on broker sites · Abrams</title>
 <style>
diff --git a/public/flyers/index.html b/public/flyers/index.html
index 6be2a9d..22ee681 100644
--- a/public/flyers/index.html
+++ b/public/flyers/index.html
@@ -1,4 +1,28 @@
-<!doctype html><html lang="en"><head><meta charset="utf-8">
+<!doctype html><html lang="en"><head>
+<script>
+// Credential-safe fetch guard (fleet drop-in) — if this page is opened with
+// credentials in the URL (a saved bookmark / Chrome-remembered basic-auth:
+// https://user:pass@host/…), the browser poisons document.baseURI, so any
+// relative or root-relative fetch('/api/…') throws "Request cannot be constructed
+// from a URL that includes credentials" and callers silently fall to an empty
+// state. Resolve every non-absolute request URL against the credential-free
+// location instead of baseURI. Placed first so it wraps window.fetch before any
+// app script runs. Ref: creds-in-url-fetch-guard-fleet-pattern.
+(function () {
+  var _fetch = window.fetch.bind(window);
+  var cleanBase = function () { return location.origin + location.pathname; };
+  window.fetch = function (input, init) {
+    try {
+      if (typeof input === 'string' && !/^[a-z]+:\/\//i.test(input) && input.indexOf('//') !== 0) {
+        input = new URL(input, cleanBase()).href;
+      } else if (input instanceof Request && !/^[a-z]+:\/\//i.test(input.url)) {
+        input = new Request(new URL(input.url, cleanBase()).href, input);
+      }
+    } catch (_) { /* fall through to native */ }
+    return _fetch(input, init);
+  };
+})();
+</script><meta charset="utf-8">
 <meta name="viewport" content="width=device-width,initial-scale=1">
 <title>Flyers — Abrams | CRE deal flyers</title>
 <style>

← ddc571b auto-data-snapshot: 2026-08-31T00:07:16 (6 data files) — dat  ·  back to Re Flyer Aggregator  ·  auto-data-snapshot: 2026-08-31T05:45:56 (6 data files) — dat d0274ec →