Games page: featured PolyWarriors listings come through a same-origin proxy (/api/public/pw-featured, 60 s cache); the page CSP blocked the direct call

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-10 18:13:09 -05:00
parent ef6c6b584e
commit 1ffca3030c
3 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -24,7 +24,7 @@
if (soon.length) S.innerHTML = '<h2 class="gsec">Opening next</h2><div class="ggrid">' + soon.map(card).join('') + '</div>';
}).catch(function () { document.getElementById('gEmpty').hidden = false; });
// featured warriors from the PolyWarriors market (2026-10-10): the rarest listings, with the forged art
fetch('https://www.polywarriors.com/api/public/featured').then(function (r) { return r.json(); }).then(function (d) {
fetch('/api/public/pw-featured').then(function (r) { return r.json(); }).then(function (d) {
var f = (d && d.featured) || []; if (!f.length) return; var S = document.getElementById('gSoon'); var host = document.createElement('div'); host.id = 'gFeatured';
host.innerHTML = '<h2 class="gsec">From the PolyWarriors market <small style="letter-spacing:0;text-transform:none;font-size:11px"> <a href="' + esc(d.market) + '" target="_blank" rel="noopener">open the market</a></small></h2><div class="fgrid">' + f.map(function (x) {
return '<a class="fcard" href="' + esc(x.url) + '" target="_blank" rel="noopener" style="--rc:' + esc(x.color) + '"><div class="fpic"><img src="' + esc(x.image) + '" alt="" loading="lazy"><span class="ftag">' + esc(x.rarity) + '</span>' + (x.forSale ? '<span class="fsale">For sale</span>' : '') + '</div><div class="fb"><b>' + esc(x.name) + ' #' + String(x.serial).padStart(4, '0') + '</b>' + (x.forge ? '<small>Forged ' + esc(x.forge.grade) + ' ' + esc(x.forge.score) + '</small>' : '') + (x.forSale ? '<span class="fp">' + esc(x.price) + ' POL</span>' : '') + '</div></a>'; }).join('') + '</div>';
+1 -1
View File
@@ -78,6 +78,6 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261007a"></script><script src="/assets/games-page.js?v=20261010b"></script>
<script src="/assets/common.js?v=20261007a"></script><script src="/assets/games-page.js?v=20261010c"></script>
</body>
</html>