Please switch to unless and positive conditions:

```ruby
    unless res and res.code == 200
      fail_with(Exploit::Failure::UnexpectedReply, "#{peer} - Upload failed")
    end
```