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

romshark / datapages / 37054565778

02 Oct 2026 07:29PM UTC coverage: 40.526% (-0.005%) from 40.531%
37054565778

push

github

romshark
fix: Refuse plain forms on App page cache actions

Require the Datastar-Request header on every action of App that takes
a datapages.PageCacheWriter, as on a page. A plain form cannot receive
the queued writes of a redirect: it gets an HTTP redirect,
which carries none. Take this action:

    // POSTReset is /reset
    func (*App) POSTReset(
        r *http.Request, pageCache datapages.PageCacheWriter,
    ) (redirect datapages.Redirect, err error) {
        pageCache.ClearAll()
        return datapages.Redirect{URL: "/"}, nil
    }

A <form method="post" action="/reset/"> gets a 302 to /, and the
worker keeps every cached page. Answer it with 406 Not Acceptable, as
for the same method on a page. Refuse a plain form to an action that
returns a body too, which keeps one rule for every action that takes
a datapages.PageCacheWriter.

4 of 5 new or added lines in 3 files covered. (80.0%)

3 existing lines in 2 files now uncovered.

14725 of 36335 relevant lines covered (40.53%)

544.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.8
/runtime/httpserve/core.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc