g2p / rfc6266

Content-Disposition header support for Python
GNU Lesser General Public License v3.0
41 stars 44 forks source link

It would be nice to have a way to bypass extension replacement in filename_sanitized #7

Open dchaplinsky opened 9 years ago

dchaplinsky commented 9 years ago

I want to use slash/dir sep and leading dots removal, yet I want to preserve extension.

Which leads to a code like this:

        parsed = parse_requests_response(resp)
        fname = parsed.filename_sanitized(
            os.path.splitext(parsed.filename_unsafe)[-1].strip("."))

Can make you a PR if you want.