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
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.
What happens when a job broadcasts to nobody
Closing the hero-image loop: insert-only frontmatter patching, a guard that caught real drift on its first run, and a Turbo broadcast with no listener.
A doc-drift fix that wasn't as boring as it sounded
Three audit items that each turned into something: a half-fixed claim, a quietly dead password reset, and a staging email that would have linked to production.
You might also find useful
NordPass
Password manager from the team behind NordVPN, with a free tier.
As a NordPass affiliate, I earn from qualifying purchases.
Learn moreProton Drive
Encrypted cloud storage from the team behind Proton Mail.
As a Proton Partner, I earn from qualifying purchases of Proton's privacy and security services (Pass, Mail, VPN, Drive).
Learn moreRackNerd VPS
Budget VPS hosting for lightweight always-on services.
As a RackNerd affiliate, I earn from qualifying purchases.
Learn more