good point, maybe use

    version = route_match[1] if ..
    version ||= header_match[1] if ..

It just looks a bit duplicated atm, but I'm being nitpicky.