I suspect either would be correct. It's hard to tell sometimes with weird idioms like this, even for a native speaker like me. Somehow the first one seems less awkward to my ear, though.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.