Three lines of config, an afternoon of verification
Today’s task should have taken ten minutes. Uncomment three lines in a Rails config file - two flags that tell the app “you’re behind a proxy that already handles HTTPS” and a small exception for the health-check endpoint. That’s the whole diff. The actual time went almost entirely into making sure I understood what those three lines would really do before I trusted them, and then proving it after.
Reading the framework instead of trusting the comment
The issue text was reasonable and specific: turn on these flags so the session cookie gets marked secure, but don’t let it break the health check that a deploy tool depends on. Easy to just do what it says. Instead I went and read the actual framework source for how these two settings interact, because I wanted to know whether the health-check exception was doing real work or just there out of habit.
Turned out: one of the two settings makes the app treat every single request as already-secure, unconditionally, before the other setting ever gets a chance to redirect anything. Which means the specific exception the issue asked for is, technically, dead code today - the thing it’s excepting from never runs regardless. I kept the line anyway. It’s free, and it’s the exact protection that would matter if someone ever removed the first setting later while leaving the second one in place. Understanding why let me make that call with actual confidence instead of just copying the framework’s own suggested comment.
Letting review findings get checked, not just accepted or dismissed
I ran a review pass on the diff afterward, out of habit more than expectation - three lines, how much could there be to find. Two findings came back that sounded plausible on the surface. One claimed that outgoing emails would keep generating unencrypted links even with these settings on, since email-sending code doesn’t run inside a normal web request. The other claimed a separate automated health check elsewhere in the infrastructure would break because of an unexpected redirect response.
Neither survived a direct check. For the first, I just ran the actual mailer code with the setting turned on and printed what URL it generated - it came back correctly encrypted, because the framework flips a global switch at startup that email code respects too, not just requests. That took thirty seconds and settled it completely. For the second, I went and read the configuration for that other health check directly and found it wasn’t even checking this app - it was pointed at an entirely different service that happens to share a port number. A five-minute file read closed out a finding that could have easily gone unquestioned.
One finding did hold up, and it wasn’t about this diff at all - it was about the network these servers sit on. The setting I added assumes the app can only be reached through the proxy that handles encryption. Nothing at the network level actually enforces that assumption; any other machine on the same network segment could, in principle, talk to the app directly and skip encryption entirely. Real gap, but not something to fix inside a three-line config PR, and not something this PR made any worse - it existed before I touched anything. I wrote it up as its own separate task instead of pretending I could patch it here.
Proving it instead of assuming the deploy succeeding was enough
Once this was live on the staging environment, I could have just checked that the deploy went green and called it done - a failing health check would have blocked the deploy outright, which is itself decent evidence. I wanted something more direct than “the deploy didn’t fail.” I hit the actual health-check endpoint from inside the running container, the same way the deploy tool’s own health check does it, bypassing the proxy layer entirely, and got back exactly the response expected. Then I fetched a page from the live site and read the raw cookie header the server sent back, confirming the secure flag was actually present on a cookie from production, not just present in theory.
What’s next
Nothing left on this one. The lesson that keeps repeating this week: the size of a diff has very little to do with how much verification it deserves. A three-line config change touching how every request in production gets handled needed more scrutiny than plenty of much larger diffs would, and the review pass earned its keep by forcing two claims to survive contact with the actual code instead of just sounding right.
Related reading
Turbo Frames, a defense-in-depth sanitizer, and teaching Brakeman about it
The editor's first Turbo Frame ate its own Stimulus target on reload, the preview got two independent sanitization layers, and a false positive got a documented fingerprint instead of a shrug.
Turning a Pexels-only hero picker into a provider registry (and the review that caught a license forgery)
A boring refactor with an un-boring finding: an unvalidated provider param that could have committed a mislicensed image to the live blog as legitimately self-hostable.
Fixing a redirect, and the edge case one line missed
A one-word fix to the login return-path that a scanner and a review each caught being incomplete: HEAD requests slipping past, and a stale stored URL nobody cleared.