• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umputun / tg-spam / 24545188010
83%

Build:
DEFAULT BRANCH: master
Ran 17 Apr 2026 02:53AM UTC
Jobs 1
Files 34
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Apr 2026 02:50AM UTC coverage: 82.89% (+0.01%) from 82.876%
24545188010

push

github

umputun
Wrap webapi router with http.CrossOriginProtection for CSRF defence

Add Go 1.25's http.NewCrossOriginProtection().Handler to the webapi
middleware chain. Previously the only protection on POST/PUT/DELETE
endpoints was HTTP basic auth, which the browser will replay on
cross-origin requests once credentials are cached. With the htmx UI
performing many state-changing operations (POST /spam, /ham,
/users/add, /dictionary/add, PUT /samples, etc), this left the
webapi vulnerable to CSRF.

The middleware checks Sec-Fetch-Site (forbidden header, set by all
major browsers since 2023) with an Origin/Host fallback. Same-origin
htmx requests pass through unchanged; non-browser API consumers (no
Sec-Fetch-Site header) also pass through.

1 of 1 new or added line in 1 file covered. (100.0%)

6986 of 8428 relevant lines covered (82.89%)

257.62 hits per line

Jobs
ID Job ID Ran Files Coverage
1 24545188010.1 17 Apr 2026 02:53AM UTC 34
82.89
GitHub Action Run
Source Files on build 24545188010
  • Tree
  • List 34
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 1eda91ae on github
  • Prev Build on master (#24160058497)
  • Next Build on master (#24546067431)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc