It looks like this isn't quite equivalent. there's an extra space in `'lms_key '` and I think you want to look for it in `header`, not `header.has_key`.