def basic_authorize(user, password)
      browser.set_http_auth(user, password)
      credentials = ["#{user}:#{password}"].pack('m*').strip
      add_header('Authorization', "Basic #{credentials}")
    end
def basic_authorize(user, password)
      browser.set_http_auth(user, password)
      credentials = ["#{user}:#{password}"].pack('m*').strip
      add_header('Authorization', "Basic #{credentials}")
    end
* PhantomJS with set settings doesn't send `Authorize` on POST request
 * With manually set header PhantomJS makes next request with
 `Authorization: Basic Og==` header when settings are empty and the
 response was `401 Unauthorized` (which means Base64.encode64(':')).
 Combining both methods to reach proper behavior.