How to get url after redirection by superagent

how does superagent get url after redirection

my previous idea was to set .redirects (0) , and then get the redirected url, by Location in the response header, but this failed

ask the great god what I should do


the encapsulation of 301 maxRetrie 302 and other status codes is one of the functional designs of superagent and other http modules. superagent will perform a recursive jump to maxRetrie when receiving 301Accord302 , so if you want to get the redirected url, you can use the native http module .

Request.prototype._pipeContinue = function(stream, options){
  this.req.once('response', res => {
    // redirect
    const redirect = isRedirect(res.statusCode);
    if (redirect && this._redirectsPP != this._maxRedirects) {
      return this._redirect(res)._pipeContinue(stream, options);
    }
    //...
  })
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e449d1-43786.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e449d1-43786.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?