Name logicsrc apps in the User-Agent of CoinPay calls (#293)

logicsrc.com (Next), app.logicsrc.com (pwa) and the rotation CLI now send a
descriptive User-Agent on every server-side CoinPay request, so CoinPay's
logs and throttle can tell them apart from the other apps on dev2:

- logicsrc.com: logicsrc.com/<version> (+https://logicsrc.com) on merchant
  eligibility, checkout sessions, OAuth token and userinfo; x402-gateway
  ^0.18.2 names the site on crawl-gateway calls.
- app.logicsrc.com: app.logicsrc.com/<version> on the CoinPay OAuth calls and,
  through coinpay-onboard 0.3.1's fetch hook, on the auto-rotation client.
- logicsrc CLI rotators: logicsrc-cli/<version> (+https://logicsrc.com).

Co-authored-by: riotcoder <riotcoder@profullstack.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Anthony Ettinger 2026-11-22 04:15:30 -08:00 • committed by GitHub
parent d8a08c006b
commit b20afe6f50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 44 additions and 12 deletions

View file

@ -1,5 +1,6 @@
import type { NextRequest } from "next/server";
import { json } from "@/lib/http";
import { COINPAY_UA } from "@/lib/coinpay-ua";
import { COINPAY_SESSION_COOKIE, parseJson, verifySession } from "@/lib/coinpay";
import { HIRE_US_PRODUCT } from "@/lib/coinpay-webhook";
import { hireUsCheckoutStore } from "@/lib/hire-us-payments";
@ -75,7 +76,8 @@ export async function POST(request: NextRequest) {
method: "POST",
headers: {
authorization: `Bearer ${apiKey}`,
"content-type": "application/json"
"content-type": "application/json",
"user-agent": COINPAY_UA
},
body: JSON.stringify({
amount: amountUsdDue,