fix(traffic): refuse cross-site requests before they spend the TomTom budget

/api/tomtom/flow was the only keyed, billed proxy left outside the cross-site gate added in #900. Every uncached tile is an upstream attempt counted against the persistent daily budget, so any web page the user visits could fire <img> requests at distinct z8-z16 tiles, spend the TomTom quota and leave the traffic layer on 429 budget for the rest of the UTC day. Gate both routes with admitSameSite, like the Places routes.
This commit is contained in:
Sunil committed 2026-10-08 20:59:38 +05:30
1 parent 95fa816232
commit 1f1dc2dca8
3 files changed
+70 -3

No files matched your search

+6 -1
View File
@@ -123,7 +123,12 @@
"traffic-provider": {
"runtime": "node",
"exports": ["./server/providers/traffic"],
"modules": ["server/providers/traffic.js", "src/data/tomtomTiles.js"],
"modules": [
"server/providers/traffic.js",
"src/data/tomtomTiles.js",
"server/providers/common/same-site.js",
"src/localRequestGate.mjs"
],
"external": []
},
"traffic-source": {