Преглед изворни кода

fix(inventory): send honest Bambuddy User-Agent on FilamentColors.xyz sync

  The Color Catalog sync built its httpx.AsyncClient with no User-Agent, so
  it leaked httpx's default python-httpx/x.y string - the only outbound
  client that did; bambu_cloud, makerworld and firmware_check all send
  Bambuddy/1.0 (+https://github.com/maziggy/bambuddy). It now sends the
  same honest UA.

  Found while investigating an issue - a Cloudflare 403 on the sync that
  turned out to be the reporter's network/IP reputation, not Bambuddy. The
  UA leak was a separate inconsistency found in passing; this change does
  not by itself resolve a Cloudflare IP block.
maziggy пре 5 дана
родитељ
комит
3286ccd7d2
2 измењених фајлова са 8 додато и 1 уклоњено
  1. 1 0
      CHANGELOG.md
  2. 7 1
      backend/app/api/routes/inventory.py

Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
CHANGELOG.md


+ 7 - 1
backend/app/api/routes/inventory.py

@@ -822,7 +822,13 @@ async def sync_from_filamentcolors(
         total_available = 0
 
         try:
-            async with httpx.AsyncClient(timeout=120.0) as client:
+            # Identify honestly as Bambuddy rather than leaking httpx's
+            # default "python-httpx/x.y" UA — consistent with every other
+            # outbound client (bambu_cloud, makerworld, firmware_check).
+            async with httpx.AsyncClient(
+                timeout=120.0,
+                headers={"User-Agent": "Bambuddy/1.0 (+https://github.com/maziggy/bambuddy)"},
+            ) as client:
                 page = 1
                 while True:
                     response = await client.get(

Неке датотеке нису приказане због велике количине промена