What's the magic? This is the same logic as lines 461-466.

Should this just be

```
if not many_files_gist or  if filename.endswith('.ipynb'):
    file = files[filename]
    nbjson = file['content']
    yield self.finish_notebook(nbjson, file['raw_url'],
        home_url=gist['html_url'],
        msg="gist: %s" % gist_id,
    )
else:
    file = files[filename]
    # cannot redirect because of X-Frame-Content
    self.finish(file['content'])
    return
```