Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mechanize test failure: undefined method last #2321

Closed
gogainda opened this issue Apr 8, 2021 · 0 comments · Fixed by #2320
Closed

mechanize test failure: undefined method last #2321

gogainda opened this issue Apr 8, 2021 · 0 comments · Fixed by #2320
Assignees
Milestone

Comments

@gogainda
Copy link
Contributor

gogainda commented Apr 8, 2021

TestMechanizeParser#test_extract_filename_content_disposition:
NoMethodError: undefined method `last' for nil:NilClass
    /Users/novoi/tmp/mechanize/lib/mechanize/parser.rb:129:in `extract_filename'
    /Users/novoi/tmp/mechanize/test/test_mechanize_parser.rb:37:in `test_extract_filename_content_disposition'

it happens here:

filename = content_disposition.filename
        filename = filename.rpartition(/[\\\/]/).last
        handled = true

If filename doesn't match the rpatition regexptit returns nil instead of ["", "", original_str]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants