1 回答
As usual, the act of posting the question revealed the answer. I have a literal /attachments
folder being served by Apache, skipping the Sinatra proxy. And then I named a route with that same name.
This application and code has been working for literally years, so some change introduced by upgrading Sinatra or Rack must have caused the bug. (Either that, or someone else modified the Apache conf without my knowledge.)
Regardless of the culprit, the fix is easy: rename the route to:
post '/attachlings/attach' do
…
end
and rewrite the view to match, and everything is fine.
Lesson: don't name routes with prefixes that are skipped by the reverse proxy.